-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Still logged in after logout #238
Comments
@OrPh4ns do you mean that |
Yes on logout user became null but on refreshing page all data getting back like XSRF-TOKEN and rest of data. there is no error in console |
I see @OrPh4ns, thanks for more info. Could you please check if the cookie with a token is also deleted after you logged out? |
Hm, the name of the cookie is hardcoded in the module code as |
Hey @OrPh4ns, I couldn't reproduce this behaviour since the token was set correctly with a proper name. So I would need more details for further investigation, especially regarding login functionality. Please, attach the details according to the template below: Module information
// REPLACE WITH YOUR FILE CONTENT!
export default defineNuxtConfig({
modules: ['nuxt-auth-sanctum'],
sanctum: {
baseUrl: 'http://localhost:80',
},
});
// REPLACE WITH YOUR FILE CONTENT!
export default defineAppConfig({
sanctum: {
// ...
},
}); Nuxt environment:
Laravel environment:
<?php
// REPLACE WITH YOUR FILE CONTENT!
return [
'paths' => ['*'],
'allowed_methods' => ['*'],
'allowed_origins' => [
env('FRONTEND_URL', 'http://localhost:3000'),
],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => true,
]; Logs Please provide module logs that can help to understand the problem.
Code sample Provide the code sample of your login/logout pages/components in the Nuxt application: // Code here |
thanks for more details @OrPh4ns, but there are some parts still missing Laravel environment:
Logs Please provide module logs that can help to understand the problem.
Code sample Provide the code sample of your login/logout pages/components in the Nuxt application: // Code here |
Laravel log level is 5 but project does not create any log file |
it depends on how you configured your environment, if you are running app by |
sometimes it works not very well since Also, for |
const {logout, user} = useSanctumAuth();
const signout = async () => {
await logout();
current_branch_name.value = null;
current_branch_number.value = null;
current_branch_role.value = null;
}
this is the function to logout but user still logged in after redirect to login page and refresh again
The text was updated successfully, but these errors were encountered: