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:
@@ -142,6 +142,14 @@ func Conflictf(ctx context.Context, format string, a ...any) *gqlerror.Error {
|
||||
return Conflict(ctx, fmt.Errorf(format, a...))
|
||||
}
|
||||
|
||||
func TokenExpired(ctx context.Context, err error) *gqlerror.Error {
|
||||
return &gqlerror.Error{
|
||||
Message: err.Error(),
|
||||
Path: graphql.GetPath(ctx),
|
||||
Extensions: map[string]any{"code": "TOKEN_EXPIRED"},
|
||||
}
|
||||
}
|
||||
|
||||
func Invalid(ctx context.Context, err error) *gqlerror.Error {
|
||||
var details map[string]any
|
||||
|
||||
|
||||
Reference in New Issue
Block a user