Skip to content

Commit

Permalink
Feat(UX): reloading web pages maintains auth context (#111)
Browse files Browse the repository at this point in the history
When a user refreshes a webpage they will remain logged in.
HMAC-based auth token persisted in the HTTP session as a cookie and in the backend using an in-mem cache.

---------

Co-authored-by: Janaka Abeywardhana <[email protected]>
  • Loading branch information
osala-eng and janaka authored Oct 2, 2023
1 parent 82bd8a5 commit a6821a6
Show file tree
Hide file tree
Showing 14 changed files with 542 additions and 177 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ cython_debug/
# Exported from Poetry, used in docker build only
requirements.txt
# Used for file storage in local development only
.persisted/
.persisted*/
# Used for running Streamlit by storing configs and secrets locally
.streamlit/
# Used by GitHub Pages local build before uploading to GitHub
Expand Down
3 changes: 2 additions & 1 deletion misc/docker.env.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
STREAMLIT_SERVER_ADDRESS=0.0.0.0
STREAMLIT_SERVER_PORT=8501 #default
DOCQ_DATA=./.persisted/
OPENAI_API_KEY # ideally set value on shell, don't insert a value here becuase it's a secret.
DOCQ_OPENAI_API_KEY # ideally set value on shell, don't insert a value here becuase it's a secret.
DOCQ_COOKIE_HMAC_SECRET_KEY=cookie_password
3 changes: 2 additions & 1 deletion misc/secrets.toml.template
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
DOCQ_DATA = "./.persisted/"
OPENAI_API_KEY = "YOUR-OPENAI-API-KEY"
DOCQ_OPENAI_API_KEY = "YOUR-OPENAI-API-KEY"
DOCQ_COOKIE_HMAC_SECRET_KEY = "32_char_secret_used_to_encrypt"
Loading

0 comments on commit a6821a6

Please sign in to comment.