Skip to content

Update new authorize UX flow #3029

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

Merged
merged 9 commits into from
Apr 15, 2025

Conversation

sea-snake
Copy link
Contributor

@sea-snake sea-snake commented Apr 14, 2025

  • Implement Google authentication
  • Use dialog element for modal/bottomsheet
  • Refactor authentication implementation, only rely on connection class at the very end.

- Implement Google authentication
- Use dialog element for modal/bottomsheet
- Refactor authentication implementation, only rely on connection class at the very end.
@sea-snake sea-snake requested a review from LXIF April 14, 2025 16:12
sea-snake and others added 4 commits April 14, 2025 18:12
- Implement Google authentication
- Use dialog element for modal/bottomsheet
- Refactor authentication implementation, only rely on connection class at the very end.
Copy link
Contributor

@LXIF LXIF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, fixed your linter warning for you :)

salt: Uint8Array;
actor: ActorSubclass<_SERVICE>;
}): Promise<{ identity: SignIdentity; anchorNumber: bigint }> => {
const identity = await identityFromActor(actor);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is of course fine and how we've been doing it - in the future, this logic could be put into a store so we can just always reference $actor and $identity - or get(actor) / get(identity) in this case (or, with some workarounds, it could also be done with state - the logic would be less elegant / self-contained but we could then access it without using get()).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actor is passed in here since it's a stateless utils function, the caller of this method may still grab the actor from a store. Passing in both an actor and identity is unnecessary since the actor already has one within.

//TODO
console.log("continuing with google");
const handleContinueWithGoogle = async () => {
const clientId = data.session.config.openid_google?.[0]?.[0]?.client_id;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future, this too (or the whole config) would probably best be put into store/state. Not vital right now though.

@LXIF
Copy link
Contributor

LXIF commented Apr 15, 2025

Forgot to mention - the bottom slider / modal no longer has its internal swiping animation. Of course fine for now, will need to discuss animations with UX to have a coherent language at some point.

@sea-snake
Copy link
Contributor Author

Forgot to mention - the bottom slider / modal no longer has its internal swiping animation. Of course fine for now, will need to discuss animations with UX to have a coherent language at some point.

Added this back :D

Copy link
Contributor

@LXIF LXIF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small things I noticed - nothing functional or egregious, so let's merge it for now. Also we'll eventually need a new loader =)

<Button onclick={handleContinueWithGoogle} variant="secondary"
>Continue with Google</Button
>
<Button class="w-full" variant="text-only">Cancel</Button>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This button does nothing.

class="w-full px-6 py-4 text-left"
variant="dashed">Use another Internet Identity</Button
>
<div>Loading...</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is displayed indefinitely when the route is visited without coming from a dapp.

export const ssr = false;

export const load: PageLoad = async () => {
const canisterId = readCanisterId();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely more elegant to load this here. For this specific route, there's not really a tradeoff, as it is only visited once - in general, because load re-runs whenever a page is visited, we may want to keep this in some kind of application state (store/$state)

</div>
{#if showPasskeyModal || nonNullish(captcha)}
<BottomCardOrModal
title={nonNullish(captcha)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When selecting "continue with passkey", the buttons jump around a tiny bit after the animation finishes. Not egregious though.

@sea-snake sea-snake added this pull request to the merge queue Apr 15, 2025
Merged via the queue into main with commit 2ca928b Apr 15, 2025
69 checks passed
@sea-snake sea-snake deleted the sea-snake/implement-google-use-dialog-and-refactor branch April 15, 2025 12:11
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.

2 participants