Add error for already used token

Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
Bryan Frimin
2026-06-05 17:54:51 +02:00
parent caeac0ed1c
commit d43526bff4
7 changed files with 82 additions and 1 deletions

View File

@@ -150,6 +150,14 @@ func TokenExpired(ctx context.Context, err error) *gqlerror.Error {
}
}
func TokenAlreadyUsed(ctx context.Context, err error) *gqlerror.Error {
return &gqlerror.Error{
Message: err.Error(),
Path: graphql.GetPath(ctx),
Extensions: map[string]any{"code": "TOKEN_ALREADY_USED"},
}
}
func Invalid(ctx context.Context, err error) *gqlerror.Error {
var details map[string]any