Replies: 18 comments 18 replies
-
We've been receiving some feedback about having signOut on the Backend, but haven't decided yet about the API 🤔 Prolly we will release it in an experimental fashion in the near future. 🤞 |
Beta Was this translation helpful? Give feedback.
-
Hi @ThangHuuVu. Do you have any new informations when signing out from backend side will be possible? :) |
Beta Was this translation helpful? Give feedback.
-
Any update on this? I'm currently using the I've spent countless days trying to get this working on an enterprise app and it seems like NextAuth just really doesn't want me using the |
Beta Was this translation helpful? Give feedback.
-
I also need server side logout.. I can't really use JWT / Session callbacks are they are called a lot. in my case I really juste want to do the verification once (on every refresh basically) Any plan for this to actually be a thing? Or potential workarounds? |
Beta Was this translation helpful? Give feedback.
-
hello, any info for this?, I have same question |
Beta Was this translation helpful? Give feedback.
-
Hello @wahyunurarizky, I had the same problem, but in my case, I wanted to log out the user when the backend API JWT token expired as I'm using a single fetch instance I created for the entire project. Also as for the project I opted to use server action for API calls and data fetching but the signout function seems to be a hook meaning it can't be called on the server side, so, to handle this I created a standalone client page log out page and use |
Beta Was this translation helpful? Give feedback.
-
Please is there any new update on this ? |
Beta Was this translation helpful? Give feedback.
-
Any update on this? Disappointing for such a simple thing to be so inelegant |
Beta Was this translation helpful? Give feedback.
-
Man, I am in soo need of this rn. |
Beta Was this translation helpful? Give feedback.
-
Would be awesome if we could get an update on this 🙏 |
Beta Was this translation helpful? Give feedback.
-
Probably a good idea to verify the csrf token here e.g.
Btw, it seems like a bad idea to clear the cookies yourself, but if you do you also need to consider the secureCookie prefix in next-auth:
|
Beta Was this translation helpful? Give feedback.
-
Plus one for the feature. It seems like a much needed feature for anyone using a backend different from their next-auth authentication to be able to logout users from server side on JWT expiry/ invalidation. |
Beta Was this translation helpful? Give feedback.
-
plus one for needing to be able to logout user server side. Using latest app dir. |
Beta Was this translation helpful? Give feedback.
-
can we just clear all of our cookies to logout? |
Beta Was this translation helpful? Give feedback.
-
I don't understand why it is so hard to do this. |
Beta Was this translation helpful? Give feedback.
-
Im also stuck on this, i even thought it exists, just realizing it doesnt |
Beta Was this translation helpful? Give feedback.
-
Docs or it didn’t happen
Sent from [Proton Mail](https://proton.me/mail/home) for iOS
…On Sun, May 5, 2024 at 3:02 AM, Sonfack Nelson Mandela ***@***.***(mailto:On Sun, May 5, 2024 at 3:02 AM, Sonfack Nelson Mandela <<a href=)> wrote:
Hey ***@***.***(https://github.com/CRIMSON-CORP) have you tried the latest version of next-auth now authjs ?
It's still in beta but it's now possible to sign out from the server.
—
Reply to this email directly, [view it on GitHub](#5334 (reply in thread)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AH3JIEUSX25IG3EJ4VHZPM3ZAX7TNAVCNFSM6AAAAAAQKS77CKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TGMJYHE4DI).
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
First step: |
Beta Was this translation helpful? Give feedback.
-
Question 💬
What would be considered proper way to sign out the user from the server side, like from
getServerSideProps
?Is it safe to just expire
next-auth.session-token
cookie (using name that is set under cookies sessionToken options)? I am aware this would not triggersignOut
event.Sending POST request to
/api/auth/signout
(with csrfToken) does not produce expected result from server side. Id does work fine when called from client.How to reproduce ☕️
Simple question. No code needed.
Contributing 🙌🏽
No, I am afraid I cannot help regarding this
Beta Was this translation helpful? Give feedback.
All reactions