Skip to content

Commit d55b947

Browse files
authored
feat: add authorize email query-param (#112)
* feat: add email authorize param * fix: docs deploy * fix: attempting to fix docs deploy
1 parent b30584f commit d55b947

5 files changed

Lines changed: 19 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ jobs:
5151
- name: Build
5252
run: pnpm build
5353

54-
- name: Generate Documentation
55-
if: github.ref == 'refs/heads/main'
56-
run: pnpm run generate-docs
57-
5854
- name: Deploy to GitHub Pages
5955
uses: peaceiris/actions-gh-pages@v4
6056
if: github.ref == 'refs/heads/main'

apps/customer/app/test/page.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,18 @@ export default function Test() {
666666
<button type="submit" onClick={authorize}>
667667
Authorize
668668
</button>
669+
<button
670+
type="submit"
671+
onClick={() =>
672+
authorize({
673+
email: 'test@test.is',
674+
skipCreateAccount: true,
675+
skipKyc: true,
676+
})
677+
}
678+
>
679+
Authorize min (skip KYC and Wallet Connection)
680+
</button>
669681
<button type="submit" onClick={autoLink}>
670682
Authorize with auto linking.
671683
</button>

packages/sdk/src/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ export class MoneriumClient {
178178
signature: params?.signature,
179179
chain: params?.chain,
180180
state: params?.state,
181+
email: params?.email,
181182
skip_create_account: params?.skipCreateAccount,
182183
skip_kyc: params?.skipKyc,
183184
});

packages/sdk/src/helpers/auth.helpers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const getAuthFlowParams = (
2626
address,
2727
signature,
2828
chain,
29+
email,
2930
skip_create_account,
3031
skip_kyc,
3132
} = args;
@@ -42,6 +43,7 @@ export const getAuthFlowParams = (
4243
client_id,
4344
redirect_uri,
4445
...(scope !== undefined ? { scope: scope } : {}),
46+
...(email !== undefined ? { email: email } : {}),
4547
...(state !== undefined ? { state: state } : {}),
4648
...(skip_create_account !== undefined
4749
? { skip_create_account: skip_create_account }

packages/sdk/src/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ export type PKCERequest = {
131131
state?: string;
132132
/** the redirect uri of the application */
133133
redirect_uri: string;
134+
/** the email of the user to prefill the login form */
135+
email?: string;
134136
/** the scope of the application */
135137
scope?: string;
136138
/** the address of the wallet to automatically link */
@@ -565,6 +567,8 @@ export interface AuthFlowOptions {
565567
clientId?: string;
566568
/** the redirect URI defined by your application */
567569
redirectUri?: string;
570+
/** the email of the user to prefill the login form */
571+
email?: string;
568572
/** the address your customer should link in auth flow */
569573
address?: string;
570574
/** the signature of the address */

0 commit comments

Comments
 (0)