Skip to content

Commit e529666

Browse files
committed
debug: added a few debug statements
1 parent b68b47c commit e529666

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/frontendmu-nuxt/auth-utils/useAuth.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,21 +107,26 @@ export default function useAuth(client: DirectusClient<any> & AuthenticationClie
107107

108108
async function loginWithSSO() {
109109
try {
110+
const cookieValue = getCookieValue('directus_session_token')
110111
const res = await fetch(
111112
'https://directus.frontend.mu/auth/refresh',
112113
{
113114
method: 'POST',
114115
credentials: 'include', // this is required in order to send the refresh token cookie
115116
body: JSON.stringify({
116-
refresh_token: getCookieValue('directus_session_token'),
117+
refresh_token: cookieValue,
117118
mode: 'cookie',
118119
}),
119120
},
120121
)
121122

123+
console.log({ cookieValue })
124+
122125
const response: { data: AuthenticationData } = await res.json()
123126

127+
console.log({ response })
124128
setCookie(response.data)
129+
console.log('trying to set cookie to ', response.data)
125130
await getCurrentUser()
126131
setAuth(true)
127132
if (!rawUser.value?.profile_picture) {

0 commit comments

Comments
 (0)