mirror of
https://github.com/m1k1o/neko.git
synced 2025-07-19 09:37:50 +02:00
MemberProfile as public type & create user on auth.
This commit is contained in:
parent
665d9d2130
commit
d1fccf5ab6
4 changed files with 18 additions and 22 deletions
|
@ -6,7 +6,6 @@ import (
|
|||
"strings"
|
||||
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -26,12 +25,9 @@ func (manager *SessionManagerCtx) Authenticate(r *http.Request) (types.Session,
|
|||
return nil, fmt.Errorf("invalid password")
|
||||
}
|
||||
|
||||
id, err := utils.NewUID(32)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return manager.New(id, isAdmin), nil
|
||||
return manager.Create(types.MemberProfile{
|
||||
IsAdmin: isAdmin,
|
||||
})
|
||||
}
|
||||
|
||||
func getToken(r *http.Request) string {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue