mirror of
https://github.com/documize/community.git
synced 2025-07-31 02:59:44 +02:00
set defaults for request context
This commit is contained in:
parent
63b24aed3f
commit
8081b60146
23 changed files with 692 additions and 666 deletions
|
@ -68,9 +68,11 @@ func (h *Handler) Login(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
dom := strings.TrimSpace(strings.ToLower(credentials[0]))
|
||||
dom = h.Store.Organization.CheckDomain(ctx, dom) // TODO optimize by removing this once js allows empty domains
|
||||
email := strings.TrimSpace(strings.ToLower(credentials[1]))
|
||||
password := credentials[2]
|
||||
|
||||
dom = h.Store.Organization.CheckDomain(ctx, dom) // TODO optimize by removing this once js allows empty domains
|
||||
|
||||
h.Runtime.Log.Info("logon attempt " + email + " @ " + dom)
|
||||
|
||||
u, err := h.Store.User.GetByDomain(ctx, dom, email)
|
||||
|
@ -108,6 +110,8 @@ func (h *Handler) Login(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
h.Runtime.Log.Info("login " + email + " @ " + dom)
|
||||
|
||||
authModel := auth.AuthenticationModel{}
|
||||
authModel.Token = GenerateJWT(h.Runtime, u.RefID, org.RefID, dom)
|
||||
authModel.User = u
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue