Skip to content

Conversation

danblackadder
Copy link
Contributor

@danblackadder danblackadder commented Sep 9, 2025

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

@danblackadder danblackadder marked this pull request as draft September 9, 2025 14:15
sessionStorage.setItem("openid_state", state);
sessionStorage.setItem("openid_nonce", options.nonce);
window.location.href = authURL.toString();
return new Promise(() => {}); // never resolves
Copy link
Contributor Author

@danblackadder danblackadder Sep 9, 2025

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

Copy link
Collaborator

@lmuntaner lmuntaner left a 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.

#3349

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?

@danblackadder
Copy link
Contributor Author

I did a PoC of this last week.

#3349

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 :)

Comment on lines 79 to 81
{#if provider}
<p class="text-text-primary">Redirecting you to {provider?.name}</p>
{/if}

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants