Add dedicated expired magic link page
Instead of a toast, expired magic link tokens now return a TOKEN_EXPIRED GraphQL error code and redirect users to a dedicated /magic-link-expired page with a clear CTA to request a new link. Signed-off-by: Bryan Frimin <bryan@getprobo.com> Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
@@ -59,7 +59,7 @@ func (r *mutationResolver) VerifyMagicLink(ctx context.Context, input types.Veri
|
||||
email, err := r.iam.AuthService.GetMagicLinkEmail(ctx, input.Token)
|
||||
if err != nil {
|
||||
if _, ok := errors.AsType[*iam.ErrExpiredToken](err); ok {
|
||||
return nil, gqlutils.Invalid(ctx, err)
|
||||
return nil, gqlutils.TokenExpired(ctx, err)
|
||||
}
|
||||
|
||||
if _, ok := errors.AsType[*iam.ErrInvalidToken](err); ok {
|
||||
@@ -80,7 +80,7 @@ func (r *mutationResolver) VerifyMagicLink(ctx context.Context, input types.Veri
|
||||
identity, session, continueURL, err = r.iam.AuthService.OpenSessionWithMagicLink(ctx, input.Token)
|
||||
if err != nil {
|
||||
if _, ok := errors.AsType[*iam.ErrExpiredToken](err); ok {
|
||||
return nil, gqlutils.Invalid(ctx, err)
|
||||
return nil, gqlutils.TokenExpired(ctx, err)
|
||||
}
|
||||
|
||||
if _, ok := errors.AsType[*iam.ErrInvalidToken](err); ok {
|
||||
@@ -102,7 +102,7 @@ func (r *mutationResolver) VerifyMagicLink(ctx context.Context, input types.Veri
|
||||
identity, session, continueURL, err = r.iam.AuthService.OpenSessionWithMagicLink(ctx, input.Token)
|
||||
if err != nil {
|
||||
if _, ok := errors.AsType[*iam.ErrExpiredToken](err); ok {
|
||||
return nil, gqlutils.Invalid(ctx, err)
|
||||
return nil, gqlutils.TokenExpired(ctx, err)
|
||||
}
|
||||
|
||||
if _, ok := errors.AsType[*iam.ErrInvalidToken](err); ok {
|
||||
|
||||
Reference in New Issue
Block a user