Can't get Bearer Token from `ctx.response.headers.get("set-auth-token")`
Next.js
According to the document, I can get the Bearer Token from my auth client. Although I logged in successfully, I can't get the Bearer Token through this method.
export const authClient = createAuthClient({ fetchOptions: { onSuccess: (ctx) => { const authToken = ctx.response.headers.get("set-auth-token") // get the token from the response headers // Store the token securely (e.g., in localStorage) if(authToken){ localStorage.setItem("bearer_token", authToken); } } }});
export const authClient = createAuthClient({ fetchOptions: { onSuccess: (ctx) => { const authToken = ctx.response.headers.get("set-auth-token") // get the token from the response headers // Store the token securely (e.g., in localStorage) if(authToken){ localStorage.setItem("bearer_token", authToken); } } }});