Skip to content

Commit

Permalink
fix(useSurrealWS): first auth check
Browse files Browse the repository at this point in the history
  • Loading branch information
sandros94 committed Jun 2, 2024
1 parent 841b8a0 commit 69c3cf1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/composables/surreal-ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function useSurrealWS<T = any>(
method: 'use',
params: [_database.value.NS, _database.value.DB],
}))
if (options?.auth !== false && _database.value === databases[authDatabase as keyof typeof databases]) {
if (userAuth.value && options?.auth !== false && _database.value === databases[authDatabase as keyof typeof databases]) {
ws.send(JSON.stringify({
id: idCounter.value++,
method: 'authenticate',
Expand Down

0 comments on commit 69c3cf1

Please sign in to comment.