diff options
author | Aspen Smith <root@gws.fyi> | 2024-03-24T18·40-0400 |
---|---|---|
committer | aspen <root@gws.fyi> | 2024-03-31T19·22+0000 |
commit | 783972182e87dcd33572e7c13563c1e7ff52f682 (patch) | |
tree | 1b20f0afbcc13b0c10ec97b2f2d797f8962fae2f /web/panettone/src | |
parent | a80c0ce95f98ae826789d0161fded4dfd2999820 (diff) |
chore(web/panettone): Make it easier to override oauth settings r/7829
For local dev, it's nice to be able to set the oauth variables by hand before starting the server - in that case, we don't want to override them with the defaults. Change-Id: I530518b4d58df1edf55ce062cf7ff3290784a3ed Reviewed-on: https://cl.tvl.fyi/c/depot/+/11259 Autosubmit: aspen <root@gws.fyi> Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
Diffstat (limited to 'web/panettone/src')
-rw-r--r-- | web/panettone/src/authentication.lisp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/web/panettone/src/authentication.lisp b/web/panettone/src/authentication.lisp index 3ce07aa8d78d..496a0e0bd7b4 100644 --- a/web/panettone/src/authentication.lisp +++ b/web/panettone/src/authentication.lisp @@ -42,23 +42,31 @@ the user, however email addresses are temporarily not available." (or (uiop:getenv "OAUTH2_REDIRECT_URI") "https://b.tvl.fyi/auth")) +(comment + (setq *oauth2-redirect-uri* "http://localhost:6161/auth") + ) + (defun initialise-oauth2 () "Initialise all settings needed for OAuth2" (setq *oauth2-auth-endpoint* - (or (uiop:getenv "OAUTH2_AUTH_ENDPOINT") + (or *oauth2-auth-endpoint* + (uiop:getenv "OAUTH2_AUTH_ENDPOINT") "https://auth.tvl.fyi/auth/realms/TVL/protocol/openid-connect/auth")) (setq *oauth2-token-endpoint* - (or (uiop:getenv "OAUTH2_TOKEN_ENDPOINT") + (or *oauth2-token-endpoint* + (uiop:getenv "OAUTH2_TOKEN_ENDPOINT") "https://auth.tvl.fyi/auth/realms/TVL/protocol/openid-connect/token")) (setq *oauth2-client-id* - (or (uiop:getenv "OAUTH2_CLIENT_ID") + (or *oauth2-client-id* + (uiop:getenv "OAUTH2_CLIENT_ID") "panettone")) (setq *oauth2-client-secret* - (or (uiop:getenv "OAUTH2_CLIENT_SECRET") + (or *oauth2-client-secret* + (uiop:getenv "OAUTH2_CLIENT_SECRET") (error "OAUTH2_CLIENT_SECRET must be set!")))) (defun auth-url () |