mirror of
https://codeberg.org/shroff/phylum.git
synced 2026-04-30 09:10:18 -05:00
[server][auth] Set userHome
This commit is contained in:
@@ -28,7 +28,13 @@ func VerifyUserPassword(d db.Handler, email, password string) (Auth, error) {
|
||||
return err
|
||||
})
|
||||
}
|
||||
return auth{userID: user.ID, homeID: user.Home, userPermissions: user.Permissions, scopes: []string{"*"}}, err
|
||||
auth := auth{
|
||||
userID: user.ID,
|
||||
homeID: user.Home,
|
||||
userPermissions: user.Permissions,
|
||||
scopes: []string{"*"},
|
||||
}
|
||||
return auth, err
|
||||
}
|
||||
|
||||
func PerformPasswordLogin(db db.TxHandler, email, password string) (Auth, string, error) {
|
||||
|
||||
@@ -70,7 +70,13 @@ func ResetUserPassword(db db.TxHandler, email, resetToken, password string) (Aut
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
return auth{userID: user.ID, userPermissions: user.Permissions, scopes: []string{"*"}}, apiKey, err
|
||||
auth := auth{
|
||||
userID: user.ID,
|
||||
homeID: user.Home,
|
||||
userPermissions: user.Permissions,
|
||||
scopes: []string{"*"},
|
||||
}
|
||||
return auth, apiKey, err
|
||||
}
|
||||
|
||||
func UpdateUserPassword(db db.TxHandler, email, password string) error {
|
||||
|
||||
@@ -25,6 +25,12 @@ func PerformTokenLogin(db db.TxHandler, token string) (Auth, string, error) {
|
||||
} else if token, err := insertAPIKey(db, userID, 0, "", []string{"*"}); err != nil {
|
||||
return nil, "", err
|
||||
} else {
|
||||
return auth{userID: user.ID, userPermissions: user.Permissions, scopes: []string{"*"}}, token, err
|
||||
auth := auth{
|
||||
userID: user.ID,
|
||||
homeID: user.Home,
|
||||
userPermissions: user.Permissions,
|
||||
scopes: []string{"*"},
|
||||
}
|
||||
return auth, token, err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user