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

feat: add different logout scopes #1112

Merged
merged 1 commit into from
Jul 3, 2023
Merged

feat: add different logout scopes #1112

merged 1 commit into from
Jul 3, 2023

Conversation

hf
Copy link
Contributor

@hf hf commented May 20, 2023

Right now, probably due to a bug, POST /logout would log the user out from all sessions they have. This is not always desired behavior.

This change adds a new scope query param on /logout with these values:

  • global (default when not provided) Logs a user out from all sessions they have.
  • local Logs a user out from the current session only.
  • others Logs a user out from all other sessions except the current one.

See:

@hf hf requested a review from a team as a code owner May 20, 2023 09:02
@hf hf force-pushed the hf/add-logout-behaviors branch 2 times, most recently from 483a9b5 to 867f9f9 Compare May 20, 2023 09:12
Copy link
Contributor

@J0 J0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think providing more flexibility in terms of logout behavior is a good idea. Thanks for jumping on the ticket!

internal/api/logout.go Outdated Show resolved Hide resolved
@kangmingtay
Copy link
Member

lets name the query param scope instead

@hf hf force-pushed the hf/add-logout-behaviors branch from c24c703 to 9a78f9f Compare July 3, 2023 07:28
@hf hf changed the title feat: add different logout behaviors feat: add different logout scopes Jul 3, 2023
@hf hf merged commit df07540 into master Jul 3, 2023
@hf hf deleted the hf/add-logout-behaviors branch July 3, 2023 07:52
@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2023

🎉 This PR is included in version 2.78.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

hf added a commit to supabase/auth-js that referenced this pull request Jul 3, 2023
Adds the `behavior` option to the `signOut` method which can be used to
control which sessions should be signed out of the account.

See:
- supabase/auth#1112
uxodb pushed a commit to uxodb/auth that referenced this pull request Nov 13, 2024
Right now, probably due to a bug, `POST /logout` would log the user out
from _all_ sessions they have. This is not always desired behavior.

This change adds a new `scope` query param on `/logout` with these
values:
- `global` (default when not provided) Logs a user out from all sessions
they have.
- `local` Logs a user out from the current session only.
- `others` Logs a user out from all other sessions except the current
one.

See:
- supabase/auth-js#713
LashaJini pushed a commit to LashaJini/auth that referenced this pull request Nov 13, 2024
Right now, probably due to a bug, `POST /logout` would log the user out
from _all_ sessions they have. This is not always desired behavior.

This change adds a new `scope` query param on `/logout` with these
values:
- `global` (default when not provided) Logs a user out from all sessions
they have.
- `local` Logs a user out from the current session only.
- `others` Logs a user out from all other sessions except the current
one.

See:
- supabase/auth-js#713
LashaJini pushed a commit to LashaJini/auth that referenced this pull request Nov 15, 2024
Right now, probably due to a bug, `POST /logout` would log the user out
from _all_ sessions they have. This is not always desired behavior.

This change adds a new `scope` query param on `/logout` with these
values:
- `global` (default when not provided) Logs a user out from all sessions
they have.
- `local` Logs a user out from the current session only.
- `others` Logs a user out from all other sessions except the current
one.

See:
- supabase/auth-js#713
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants