update auth service to handle user creation errors and expand consent request scopes
This commit is contained in:
@ -48,9 +48,6 @@ func (a authService) getUserByPhoneNumber(ctx context.Context, phoneNumber strin
|
||||
|
||||
func (a authService) getOrCreateUser(ctx context.Context, phoneNumber string) (*userDomain.User, error) {
|
||||
user, err := a.userService.GetUserByPhoneNumber(ctx, phoneNumber)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if user == nil {
|
||||
user, err = a.userService.CreateUser(ctx, phoneNumber)
|
||||
if err != nil {
|
||||
@ -91,7 +88,7 @@ func (a authService) AcceptConsent(ctx context.Context, phoneNumber string, chal
|
||||
return "", err
|
||||
}
|
||||
request := hydraApi.AcceptConsentRequest{}
|
||||
request.SetGrantScope([]string{"openid"})
|
||||
request.SetGrantScope([]string{"openid", "offline", "offline_access"})
|
||||
request.SetRemember(true)
|
||||
request.SetRememberFor(3600)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user