Skip to content
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

Showcase registration flow #1836

Merged
merged 1 commit into from
Aug 29, 2023
Merged

Showcase registration flow #1836

merged 1 commit into from
Aug 29, 2023

Conversation

nmattia
Copy link
Collaborator

@nmattia nmattia commented Aug 29, 2023

This refactors the register function to be able to showcase the registration flow without needing to spin up a canister.

A type parameter had to be added to RegisterResult to allow "mocking" the result without creating an actual canister connection.

The flow part is extracted from register, which is now a wrapper around this new registerFlow; register now only deals with canister/concrete implementation details whereas registerFlow only focuses on the user interaction.


🟡 Some screens were changed

import { displayUserNumberWarmup } from "./finish";
import { savePasskey } from "./passkey";

/** Registration (anchor creation) flow for new users */
export const registerFlow = async <T>({
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

most of this is was just extracted from register

@@ -83,17 +83,17 @@ export type LoginResult =
| NoSeedPhrase
| SeedPhraseFail
| CancelOrTimeout;
export type RegisterResult =
| LoginSuccess
export type RegisterResult<T = AuthenticatedConnection> =
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

these types are a mess but I don't have time to clean this up right now

This refactors the `register` function to be able to showcase the
registration flow without needing to spin up a canister.

A type parameter had to be added to `RegisterResult` to allow "mocking"
the result without creating an actual canister connection.

The flow part is extracted from `register`, which is now a wrapper
around this new `registerFlow`; `register` now only deals with
canister/concrete implementation details whereas `registerFlow` only
focuses on the user interaction.
Copy link
Member

@frederikrothenberger frederikrothenberger left a comment

Choose a reason for hiding this comment

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

Rubber stamp

@nmattia nmattia added this pull request to the merge queue Aug 29, 2023
@nmattia nmattia removed this pull request from the merge queue due to a manual request Aug 29, 2023
@nmattia nmattia merged commit cdbad0e into main Aug 29, 2023
49 checks passed
@nmattia nmattia deleted the nm-register-flow branch August 29, 2023 13:54
nmattia added a commit that referenced this pull request Sep 1, 2023
This extracts the flow essence of the authenticateBox so that the flow
can be showcased on `/flows/loginManage`.

In practice, most canister calls were abstracted away so that the flow
can be used without an actual canister. Similar to the registration flow
showcased in #1836.
@nmattia nmattia mentioned this pull request Sep 1, 2023
github-merge-queue bot pushed a commit that referenced this pull request Sep 1, 2023
This extracts the flow essence of the authenticateBox so that the flow
can be showcased on `/flows/loginManage`.

In practice, most canister calls were abstracted away so that the flow
can be used without an actual canister. Similar to the registration flow
showcased in #1836.
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.

None yet

2 participants