Skip to content

Commit

Permalink
feat: add email authorize param
Browse files Browse the repository at this point in the history
  • Loading branch information
einaralex committed Jan 7, 2025
1 parent b30584f commit df3d5be
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apps/customer/app/test/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,18 @@ export default function Test() {
<button type="submit" onClick={authorize}>
Authorize
</button>
<button
type="submit"
onClick={() =>
authorize({
email: '[email protected]',
skipCreateAccount: true,
skipKyc: true,
})
}
>
Authorize min (skip KYC and Wallet Connection)
</button>
<button type="submit" onClick={autoLink}>
Authorize with auto linking.
</button>
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export class MoneriumClient {
signature: params?.signature,
chain: params?.chain,
state: params?.state,
email: params?.email,
skip_create_account: params?.skipCreateAccount,
skip_kyc: params?.skipKyc,
});
Expand Down
2 changes: 2 additions & 0 deletions packages/sdk/src/helpers/auth.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const getAuthFlowParams = (
address,
signature,
chain,
email,
skip_create_account,
skip_kyc,
} = args;
Expand All @@ -42,6 +43,7 @@ export const getAuthFlowParams = (
client_id,
redirect_uri,
...(scope !== undefined ? { scope: scope } : {}),
...(email !== undefined ? { email: email } : {}),
...(state !== undefined ? { state: state } : {}),
...(skip_create_account !== undefined
? { skip_create_account: skip_create_account }
Expand Down
4 changes: 4 additions & 0 deletions packages/sdk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ export type PKCERequest = {
state?: string;
/** the redirect uri of the application */
redirect_uri: string;
/** the email of the user to prefill the login form */
email?: string;
/** the scope of the application */
scope?: string;
/** the address of the wallet to automatically link */
Expand Down Expand Up @@ -565,6 +567,8 @@ export interface AuthFlowOptions {
clientId?: string;
/** the redirect URI defined by your application */
redirectUri?: string;
/** the email of the user to prefill the login form */
email?: string;
/** the address your customer should link in auth flow */
address?: string;
/** the signature of the address */
Expand Down

0 comments on commit df3d5be

Please sign in to comment.