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

ui: login: remember that user has a session #25171

Closed
vilterp opened this issue Apr 30, 2018 · 0 comments · Fixed by #25195
Closed

ui: login: remember that user has a session #25171

vilterp opened this issue Apr 30, 2018 · 0 comments · Fixed by #25195
Assignees
Labels
A-webui-security C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Comments

@vilterp
Copy link
Contributor

vilterp commented Apr 30, 2018

If a user has logged in and opens another page, they should not be prompted to enter their username and password again; the page should somehow remember that they have a session.

Do this either by:

  • Storing it browser-side in localStorage
  • Templating index.html server-side with a variable such as window.loggedInUser = 'vilterp'.
@vilterp vilterp added A-webui-security C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) labels Apr 30, 2018
@vilterp vilterp self-assigned this May 2, 2018
craig bot pushed a commit that referenced this issue May 16, 2018
25195: server, ui: login: template logged in user into index.html r=couchand a=vilterp

...instead of serving a static index.html generated at build time via a webpack plugin. This allows the UI to decide whether it needs to show a login UI (and show the logged in username if there is one) without making an additional request to the backend.

Fixes #25171 

TODO:
- [x] make sure this doesn't break `make buildshort`
- [x] favicon not showing up
- tests
    - [x] insecure: can get assets, index.html doesn't have user
    - secure
        - [x] logged out: can get assets, index.html doesn't have user
        - [x] logged in: can get assets, index.html has user
- [x] fix race condition where health check endpoint crashes server before it's fully started up

Release note: None

Co-authored-by: Pete Vilter <[email protected]>
Co-authored-by: Andrew Couch <[email protected]>
@craig craig bot closed this as completed in #25195 May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-webui-security C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant