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

feat: oauth add passkey after signup (popup flow) #1151

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3882dca
chore: local dev changes updated
linnall Oct 30, 2024
8ab130a
Merge branch 'main' into social-auth-dev
linnall Oct 31, 2024
ca9e5fd
chore: merge in main
linnall Nov 1, 2024
0a63891
chore: wip oauth redirect with add passkey after signup
linnall Nov 4, 2024
f62b9c8
Merge branch 'main' into social-auth-dev
linnall Nov 5, 2024
8b42698
Merge branch 'main' into social-auth-dev
linnall Nov 8, 2024
bf02b3c
chore: wip
linnall Nov 8, 2024
5d5951a
refactor: remove a few things so we can test redirect
moldy530 Nov 8, 2024
ee46248
refactor: just render the pop-up on completed login for oauth
moldy530 Nov 8, 2024
13b1156
refactor: add new user signup event in signer
moldy530 Nov 8, 2024
1101154
refactor: add hook to listen to signup events
moldy530 Nov 8, 2024
c3aa3bf
chore: wip
linnall Nov 8, 2024
a559ab7
refactor: use signup event to popup passkey create
moldy530 Nov 8, 2024
f4a9d94
fix: the modal was staying open
moldy530 Nov 8, 2024
9b504a3
fix: move setAuthStep in the correct card
moldy530 Nov 8, 2024
0b592c0
fix: infinite subscribe loop
moldy530 Nov 8, 2024
d2c862c
fix: don't open passkey create until logged in
moldy530 Nov 8, 2024
979442b
Merge branch 'main' into social-auth-dev
linnall Nov 8, 2024
998463e
chore: remove local dev callback url
linnall Nov 8, 2024
1e04872
Merge branch 'main' into linna/oauth-add-passkey
linnall Nov 11, 2024
85edb03
chore: removes unecessary bangs and refactors for readability
linnall Nov 11, 2024
a853832
chore: removes unused usePrevious hook
linnall Nov 12, 2024
195149e
Merge branch 'main' into linna/oauth-add-passkey
linnall Nov 12, 2024
f061538
Merge branch 'main' into linna/oauth-add-passkey
linnall Nov 12, 2024
6060220
fix: update useNewUserSignup to remove listener on dismount and when …
linnall Nov 12, 2024
c0e796a
docs: link related discussion to TODO
linnall Nov 12, 2024
e1dda2f
refactor: adds emitNewUserEvent wrapper
linnall Nov 12, 2024
8d10d70
chore: restore oauth mode to popup
linnall Nov 12, 2024
46f694e
Merge branch 'main' into linna/oauth-add-passkey
linnall Nov 12, 2024
78e37ed
chore: remove logging
linnall Nov 13, 2024
1975bdd
chore: remove logging
linnall Nov 13, 2024
d952810
chore: reset oauth mode to popup
linnall Nov 13, 2024
640a7de
fix: handle undefined isNewUser within emitNewUserEvent wrapper
linnall Nov 13, 2024
1adcbd7
chore: remove unnecessary bang
linnall Nov 13, 2024
49309d8
Merge branch 'main' into linna/oauth-add-passkey
linnall Nov 13, 2024
6b17b45
Merge branch 'main' into linna/oauth-add-passkey-popup
linnall Nov 13, 2024
c1f44c6
Merge branch 'main' into linna/oauth-add-passkey-popup
linnall Nov 13, 2024
d72fa1a
feat: sets up event for client to emit to trigger signer to emit new …
linnall Nov 13, 2024
ac8dc20
Merge branch 'main' into linna/oauth-add-passkey-popup
linnall Nov 13, 2024
f7f650b
Merge branch 'main' into linna/oauth-add-passkey-popup
linnall Nov 14, 2024
995a210
chore: adds logging
linnall Nov 14, 2024
aa12a59
fix: solve the race condition on new user signup
moldy530 Nov 14, 2024
529fe0a
refactor: changes newUserSignupClient to newUserSignup
linnall Nov 14, 2024
0364404
Merge branch 'main' into linna/oauth-add-passkey-popup
linnall Nov 14, 2024
e7a76d3
chore: remove console trace
linnall Nov 14, 2024
e3467ba
chore: remove empty line
linnall Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions account-kit/signer/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,11 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
}
})();

// trigger new user event on signer from client
this.inner.on("newUserSignupClient", () => {
this.emitNewUserEvent(true);
});

this.store.setState({
status,
error: null,
Expand Down
2 changes: 2 additions & 0 deletions account-kit/signer/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,11 @@ export class AlchemySignerWebClient extends BaseSignerClient<ExportWalletParams>
alchemyBundle: bundle,
alchemyOrgId: orgId,
alchemyIdToken: idToken,
alchemyIsSignup: isSignup,
alchemyError,
} = event.data;
if (bundle && orgId && idToken) {
if (isSignup === true) this.eventEmitter.emit("newUserSignupClient");
cleanup();
popup?.close();
this.completeAuthWithBundle({
Expand Down
1 change: 1 addition & 0 deletions account-kit/signer/src/client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export type AuthenticatingEventMetadata = {

export type AlchemySignerClientEvents = {
connected(user: User): void;
newUserSignupClient(): void;
linnall marked this conversation as resolved.
Show resolved Hide resolved
authenticating(data: AuthenticatingEventMetadata): void;
connectedEmail(user: User, bundle: string): void;
connectedPasskey(user: User): void;
Expand Down
Loading