Skip to content
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

Allow re-auth #10

Open
lwansbrough opened this issue Aug 18, 2020 · 1 comment
Open

Allow re-auth #10

lwansbrough opened this issue Aug 18, 2020 · 1 comment
Labels
feature desired new functionality naia pertaining to naia crates

Comments

@lwansbrough
Copy link

lwansbrough commented Aug 18, 2020

Hey there, I've got a suggestion for auth: It would be helpful to be able to re-auth at any point, in the case where the user's session is going to expire while the user is connected.

@ghost
Copy link

ghost commented Aug 18, 2020

Yeah definitely! Thanks for the suggestion. There's a couple ways to do this, I don't have an opinion around the implementation at the moment.

My initial thought is:

  1. NaiaServer could expose a method like: send_reauth_request(key: UserKey, timeout: Duration)
  2. Which triggers a ReauthRequest event on NaiaClient, which must be responded to using a send_reauth_response(reauthEvent: Event).
  3. Then in NaiaServer you could either reuse the "on_auth()" callback method, or have a new "on_reauth()" callback, that processes the reauth event payload.
  4. If a user does not successfully re-auth within the given timeout, then they are forcibly disconnected.

Anyone else have thoughts on how to go about this? Any good examples of other crates that have a pattern for this?

@connorcarpenter connorcarpenter added naia pertaining to naia crates feature desired new functionality labels Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature desired new functionality naia pertaining to naia crates
Projects
None yet
Development

No branches or pull requests

2 participants