company selection
This commit is contained in:
@@ -3,6 +3,7 @@ package api
|
|||||||
import (
|
import (
|
||||||
"bordro-esleme/api/public"
|
"bordro-esleme/api/public"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.makki.io/makki/libgo/napi"
|
||||||
"git.makki.io/makki/libgo/nauth"
|
"git.makki.io/makki/libgo/nauth"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
@@ -56,11 +57,27 @@ func HttpHandler(re enums.TRunEnv) http.Handler {
|
|||||||
//protected end points
|
//protected end points
|
||||||
mr.Group(func(r chi.Router) {
|
mr.Group(func(r chi.Router) {
|
||||||
// Seek, verify and validate JWT tokens
|
// Seek, verify and validate JWT tokens
|
||||||
r.Use(jwtauth.Verifier(nauth.JWT))
|
r.Use(jwtauth.Verifier(svc.S.JWT))
|
||||||
|
|
||||||
// Handle valid / invalid tokens.
|
// Handle valid / invalid tokens.
|
||||||
r.Use(nauth.CheckTokenValidity)
|
r.Use(nauth.CheckTokenValidity)
|
||||||
|
|
||||||
|
r.Get("/sy/companies", napi.CompanyList)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
mux.Route("/sy", func(mr chi.Router) {
|
||||||
|
// Public Route endpoints
|
||||||
|
|
||||||
|
//protected end points
|
||||||
|
mr.Group(func(r chi.Router) {
|
||||||
|
// Seek, verify and validate JWT tokens
|
||||||
|
r.Use(jwtauth.Verifier(svc.S.JWT))
|
||||||
|
|
||||||
|
// Handle valid / invalid tokens.
|
||||||
|
r.Use(nauth.CheckTokenValidity)
|
||||||
|
|
||||||
|
r.Get("/companies", napi.CompanyList)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user