initial auth from subscriber app
This commit is contained in:
18
svc/api/public/login.go
Normal file
18
svc/api/public/login.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package public
|
||||
|
||||
import (
|
||||
"git.makki.io/makki/libgo/mhttp"
|
||||
"git.makki.io/makki/libgo/svc"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func login(w http.ResponseWriter, r *http.Request) {
|
||||
authResp, err := svc.S.Authenticate(r)
|
||||
if err != nil {
|
||||
mhttp.InternalServerError(w, err)
|
||||
return
|
||||
}
|
||||
|
||||
clientResp := authResp.GetEndUserReponse()
|
||||
mhttp.ResponseSuccess(w, clientResp)
|
||||
}
|
||||
14
svc/api/public/zrouter.go
Normal file
14
svc/api/public/zrouter.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package public
|
||||
|
||||
import (
|
||||
"github.com/go-chi/chi/v5"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func Router() http.Handler {
|
||||
r := chi.NewRouter()
|
||||
|
||||
// user authentication
|
||||
r.Post("/login", login)
|
||||
return r
|
||||
}
|
||||
Reference in New Issue
Block a user