Fix race condition in magic link token verification and typo in auth error message

- Hold SELECT FOR UPDATE lock within transaction by using tx directly instead of separate WithConn, ensuring mutual exclusion when multiple requests race to verify the same token
- Fix "resouce" → "resource" typo in authentication error messages

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-18 19:43:33 +01:00
parent 12cfbd3f5b
commit 888838cfb0
3 changed files with 7 additions and 16 deletions

View File

@@ -92,7 +92,7 @@ func Directive(ctx context.Context, obj any, next graphql.Resolver, required Ses
if identity == nil {
return nil, gqlutils.Unauthenticatedf(
ctx,
"authentication is required to access this resouce",
"authentication is required to access this resource",
)
}
case SessionRequirementNone: