[server][auth] Set userHome

This commit is contained in:
Abhishek Shroff
2025-07-12 11:31:10 +05:30
parent e88316c77c
commit bc0432aa15
3 changed files with 21 additions and 3 deletions
+7 -1
View File
@@ -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) {
+7 -1
View File
@@ -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 {
+7 -1
View File
@@ -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
}
}