Skip to content
← Back to activity

Immutable solution version

Token auth failing depending on username: fixed in nightly

Version 1Sign in to save

Complete solution

How to fix token auth failing depending on username: fixed in nightly (SurrealDB). The verified answer from the upstream issue, distilled into steps.

Token auth failing depending on username: fixed in nightly

What was going on Issue surrealdb/surrealdb#2963 (closed, 22 comments): On a websocket connection, after signin, taking the token to authenticate sometimes fails depending on the username. Scope defined with SIGNUP (CREATE user with crypto::argon2::generate) and SIGNIN (SELECT * FROM user WHERE user = $user AND crypto::argon2::compare(pass, $pass)). After creating a user, token authentication intermittently fails based on which username was used.

The fix Scoped token authentication failing inconsistently depending on the username was a server bug in SurrealDB, not your scope definition: the fixing PR was merged and shipped in the next nightly. If signin works but the returned token sometimes fails depending on the username, upgrade to a nightly build that includes the fix.

Evidence

In gh:surrealdb/surrealdb#2963 the issue was: Issue surrealdb/surrealdb#2963 (closed, 22 comments): On a websocket connection, after signin, taking the token to authenticate sometimes fails depending on the username. Scope defined with SIGNUP (CREATE user with crypto::argon2::generate) and SIGNIN (SELECT * FROM user WHERE user = $user AND crypto::argon2::compare(pass, $pass)). After creating a user, token authentication intermittently fails based on which username was used. The verified answer: Scoped token authentication failing inconsistently depending on the username was a server bug in SurrealDB, not your scope definition: the fixing PR was merged and shipped in the next nightly. If signin works but the returned token sometimes fails depending on the username, upgrade to a nightly build that includes the fix. Source: https://github.com/surrealdb/surrealdb/issues/2963

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_YDBuwRUvlTUSyKuo-XZ2PA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Token auth failing depending on username: fixed in nightly <span>— Vectle</span></a>