mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
feat: create RequestPasswordReset
This commit is contained in:
39
framework/vendure/schema.d.ts
vendored
39
framework/vendure/schema.d.ts
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
import { ResetPassword } from './schema.d';
|
||||||
|
import { requestPasswordReset } from '@framework/schema';
|
||||||
export type Maybe<T> = T | null
|
export type Maybe<T> = T | null
|
||||||
export type Exact<T extends { [key: string]: unknown }> = {
|
export type Exact<T extends { [key: string]: unknown }> = {
|
||||||
[K in keyof T]: T[K]
|
[K in keyof T]: T[K]
|
||||||
@@ -3095,6 +3097,36 @@ export type LoginMutation = { __typename?: 'Mutation' } & {
|
|||||||
>)
|
>)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type ResetPasswordMutation = { __typename?: 'Mutation' } & {
|
||||||
|
resetPassword:
|
||||||
|
| ({ __typename: 'CurrentUser' } & Pick<CurrentUser, 'id'>)
|
||||||
|
| ({ __typename: 'PasswordResetTokenInvalidError' } & Pick<
|
||||||
|
PasswordResetTokenInvalidError,
|
||||||
|
'errorCode' | 'message'
|
||||||
|
>)
|
||||||
|
| ({ __typename: 'PasswordResetTokenExpiredError' } & Pick<
|
||||||
|
PasswordResetTokenExpiredError,
|
||||||
|
'errorCode' | 'message'
|
||||||
|
>)
|
||||||
|
| ({ __typename: 'NativeAuthStrategyError' } & Pick<
|
||||||
|
NativeAuthStrategyError,
|
||||||
|
'errorCode' | 'message'
|
||||||
|
>)
|
||||||
|
}
|
||||||
|
|
||||||
|
export type SignupMutation = { __typename?: 'Mutation' } & {
|
||||||
|
registerCustomerAccount:
|
||||||
|
| ({ __typename: 'Success' } & Pick<Success, 'success'>)
|
||||||
|
| ({ __typename: 'MissingPasswordError' } & Pick<
|
||||||
|
MissingPasswordError,
|
||||||
|
'errorCode' | 'message'
|
||||||
|
>)
|
||||||
|
| ({ __typename: 'NativeAuthStrategyError' } & Pick<
|
||||||
|
NativeAuthStrategyError,
|
||||||
|
'errorCode' | 'message'
|
||||||
|
>)
|
||||||
|
}
|
||||||
|
|
||||||
export type VerifyCustomerAccountVariables = Exact<{
|
export type VerifyCustomerAccountVariables = Exact<{
|
||||||
token: Scalars['String']
|
token: Scalars['String']
|
||||||
password?: Maybe<Scalars['String']>
|
password?: Maybe<Scalars['String']>
|
||||||
@@ -3148,8 +3180,9 @@ export type SignupMutationVariables = Exact<{
|
|||||||
input: RegisterCustomerInput
|
input: RegisterCustomerInput
|
||||||
}>
|
}>
|
||||||
|
|
||||||
export type SignupMutation = { __typename?: 'Mutation' } & {
|
|
||||||
registerCustomerAccount:
|
export type RequestPasswordReset = { __typename?: 'Mutation' } & {
|
||||||
|
requestPasswordReset:
|
||||||
| ({ __typename: 'Success' } & Pick<Success, 'success'>)
|
| ({ __typename: 'Success' } & Pick<Success, 'success'>)
|
||||||
| ({ __typename: 'MissingPasswordError' } & Pick<
|
| ({ __typename: 'MissingPasswordError' } & Pick<
|
||||||
MissingPasswordError,
|
MissingPasswordError,
|
||||||
@@ -3161,6 +3194,8 @@ export type SignupMutation = { __typename?: 'Mutation' } & {
|
|||||||
>)
|
>)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export type ActiveCustomerQueryVariables = Exact<{ [key: string]: never }>
|
export type ActiveCustomerQueryVariables = Exact<{ [key: string]: never }>
|
||||||
|
|
||||||
export type ActiveCustomerQuery = { __typename?: 'Query' } & {
|
export type ActiveCustomerQuery = { __typename?: 'Query' } & {
|
||||||
|
@@ -0,0 +1,14 @@
|
|||||||
|
export const requestPasswordReset = /* GraphQL */ `
|
||||||
|
mutation RequestPasswordReset($emailAddress: String!) {
|
||||||
|
requestPasswordReset(emailAddress: $emailAddress) {
|
||||||
|
__typename
|
||||||
|
...on Success{
|
||||||
|
success
|
||||||
|
}
|
||||||
|
...on ErrorResult{
|
||||||
|
errorCode
|
||||||
|
message
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`
|
15
framework/vendure/utils/mutations/reset-password-mutation.ts
Normal file
15
framework/vendure/utils/mutations/reset-password-mutation.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
export const resetPasswordMutation = /* GraphQL */ `
|
||||||
|
mutation resetPassword($token: String!,$password: String!){
|
||||||
|
resetPassword(token: $token,password: $password){
|
||||||
|
__typename
|
||||||
|
...on CurrentUser{
|
||||||
|
id
|
||||||
|
identifier
|
||||||
|
}
|
||||||
|
...on ErrorResult{
|
||||||
|
errorCode
|
||||||
|
message
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`
|
Reference in New Issue
Block a user