-
Notifications
You must be signed in to change notification settings - Fork 156
Add AuthMethod parameter to login page to allow for automatic authentication from external sources #3347
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
src/frontend/src/lib/utils/openID.ts
Outdated
sessionStorage.setItem("openid_state", state); | ||
sessionStorage.setItem("openid_nonce", options.nonce); | ||
window.location.href = authURL.toString(); | ||
return new Promise(() => {}); // never resolves |
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.
this is purely to please TypeScript, ultimately the users url is changed, so this will never get hit anyway, unless for some weird strange reason window.location.href fails O.o
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.
I did a PoC of this last week.
The problem is that this isn't working on (at least) Safari because the popup is blocked.
Did you test your PR? I don't see how it's triggered... How where you planning on triggering it? Did you test it?
I wasn't able to test on Safari, because Apple outright refuse to allow me to download it on Windows :) However, we are not using a popup, so I see no reason why this would fail - as it is instead a redirect - it works on Chrome and Edge. If you can test on Safari that would be appreciated :) |
src/frontend/src/routes/(new-styling)/auth-redirect/+page.svelte
Outdated
Show resolved
Hide resolved
{#if provider} | ||
<p class="text-text-primary">Redirecting you to {provider?.name}</p> | ||
{/if} |
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.
In svelte, is the #if provider
not enough to negate the need for the optional chaining on provider?.name
?
Co-authored-by: edenchazard <[email protected]>
…o db-enable-auth-method-param
…o db-enable-auth-method-param
Motivation
Caffeine.AI requires the ability to automatically initiate authentication directly from Caffeine through II by passing a URL parameter that then initiates the flow.
Changes
Tests