Skip to content

Commit 4e0049e

Browse files
authored
Fix: Starts OAuth sign-in flow when clicked (#17)
1 parent 23f1ac0 commit 4e0049e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/runtime/composables/useSession.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ export default async (initialGetSessionOptions: UseSessionOptions = {}) => {
9999
action = 'callback'
100100
}
101101

102+
const csrfTokenResult = await getCsrfToken()
103+
const csrfToken = csrfTokenResult.value.csrfToken
104+
102105
const data = await _fetch<{ url: string }>(`${action}/${provider}`, {
103106
method: 'post',
104107
headers: {
@@ -108,7 +111,7 @@ export default async (initialGetSessionOptions: UseSessionOptions = {}) => {
108111
// @ts-expect-error
109112
body: new URLSearchParams({
110113
...options,
111-
csrfToken: await getCsrfToken(),
114+
csrfToken,
112115
callbackUrl,
113116
json: true
114117
})

0 commit comments

Comments
 (0)