Replug password sign in

Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
Émile Ré
2025-12-19 19:35:27 +01:00
committed by Bryan Frimin
parent f72851df4d
commit e4df37b5c8
6 changed files with 223 additions and 313 deletions

View File

@@ -36,10 +36,10 @@ var (
},
}
ErrUnauthorized = &gqlerror.Error{
Message: "You are not authorized to access this resource",
ErrUnauthenticated = &gqlerror.Error{
Message: "You must be authenticated to access this resouce",
Extensions: map[string]any{
"code": "UNAUTHORIZED",
"code": "UNAUTHENTICATED",
},
}
@@ -58,7 +58,7 @@ func SessionDirective(ctx context.Context, obj any, next graphql.Resolver, requi
case types.SessionRequirementOptional:
case types.SessionRequirementPresent:
if session == nil {
return nil, ErrUnauthorized
return nil, ErrUnauthenticated
}
case types.SessionRequirementNone:
if session != nil {