-
Notifications
You must be signed in to change notification settings - Fork 37
Improve session expiry UX with login prompt and automatic recovery #730
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
base: main
Are you sure you want to change the base?
Conversation
9f9b099 to
87cd9c1
Compare
- Show "Log In" button when session expires instead of just a message - Keep deployment info after session expiry for easier re-login - Automatically recover session when tokens are refreshed in another window - Validate OAuth scopes to detect permission changes - Consolidate duplicated OAuth constants
87cd9c1 to
ae4df51
Compare
code-asher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
src/deployment/deploymentManager.ts
Outdated
|
|
||
| if (auth) { | ||
| this.client.setCredentials(auth.url, auth.token); | ||
| if (this.contextManager.get("coder.authenticated")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nbd but would calling this.isAuthenticated() make sense here since it does the same thing?
| this.refresh(); | ||
| } | ||
|
|
||
| public dispose() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels like if we have dispose and clear they should do different things, like is dispose meant to ensure the provider cannot be used again or something? In which case maybe we can formalize that with a boolean check or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dispose meant to ensure the provider cannot be used again or something?
Indeed, I'll add a boolean check then!
Summary
Fixes #723