8000 Add support for some sort of logout ? · Issue #35 · thoughtbot/Superb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for some sort of logout ? #35

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

Closed
nashfive opened this issue Aug 21, 2017 · 1 comment
Closed

Add support for some sort of logout ? #35

nashfive opened this issue Aug 21, 2017 · 1 comment

Comments

@nashfive
Copy link

Superb is working great so far in our code.

One thing we are missing though is some sort of a manual logout process (i.e., clearing the token). Keeping an external reference on the token storage and calling clearToken() seem too easy and might be dangerous because of multi-threading.

Do you think that adding a logout() method on the request authorizer is a better way to reach that goal ?

@sharplet
Copy link
Contributor

I think it should be straightforward to expose a clearToken() method to RequestAuthorizer that updates the token storage in a thread-safe way. I've been trying to think about whether this would interact in a confusing way with the authentication state, but I can't think of any issues:

  • If you call clearToken() while unauthenticated, nothing happens
  • If you call clearToken() while authenticating, nothing happens, and you are still authenticating. Pending requests will be unaffected.
  • If you call clearToken() while authenticated, you can safely update your UI accordingly (provided no error is thrown when accessing the keychain). Subsequent requests will just show the authentication UI again.

I'm working on a PR for this, so you should have something to test out soon.

Superb is working great so far in our code.

That's great to hear! 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0