File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/frontendmu-nuxt/auth-utils Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -107,21 +107,26 @@ export default function useAuth(client: DirectusClient<any> & AuthenticationClie
107
107
108
108
async function loginWithSSO ( ) {
109
109
try {
110
+ const cookieValue = getCookieValue ( 'directus_session_token' )
110
111
const res = await fetch (
111
112
'https://directus.frontend.mu/auth/refresh' ,
112
113
{
113
114
method : 'POST' ,
114
115
credentials : 'include' , // this is required in order to send the refresh token cookie
115
116
body : JSON . stringify ( {
116
- refresh_token : getCookieValue ( 'directus_session_token' ) ,
117
+ refresh_token : cookieValue ,
117
118
mode : 'cookie' ,
118
119
} ) ,
119
120
} ,
120
121
)
121
122
123
+ console . log ( { cookieValue } )
124
+
122
125
const response : { data : AuthenticationData } = await res . json ( )
123
126
127
+ console . log ( { response } )
124
128
setCookie ( response . data )
129
+ console . log ( 'trying to set cookie to ' , response . data )
125
130
await getCurrentUser ( )
126
131
setAuth ( true )
127
132
if ( ! rawUser . value ?. profile_picture ) {
You can’t perform that action at this time.
0 commit comments