fix typo
This commit is contained in:
parent
92122e3abb
commit
f434be7d73
8
package-lock.json
generated
8
package-lock.json
generated
|
@ -10,7 +10,7 @@
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@authorizerdev/authorizer-js": "1.2.11",
|
"@authorizerdev/authorizer-js": "2.0.0",
|
||||||
"@solid-primitives/pagination": "0.2.10",
|
"@solid-primitives/pagination": "0.2.10",
|
||||||
"cropperjs": "1.6.1",
|
"cropperjs": "1.6.1",
|
||||||
"form-data": "4.0.0",
|
"form-data": "4.0.0",
|
||||||
|
@ -387,9 +387,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@authorizerdev/authorizer-js": {
|
"node_modules/@authorizerdev/authorizer-js": {
|
||||||
"version": "1.2.11",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@authorizerdev/authorizer-js/-/authorizer-js-1.2.11.tgz",
|
"resolved": "https://registry.npmjs.org/@authorizerdev/authorizer-js/-/authorizer-js-2.0.0.tgz",
|
||||||
"integrity": "sha512-onATswFYM0QCmhFPJmjS+S7Z0GNqlekqkDdFK6Bj3OeMBDQufARRHmVIGVI+0IlB7TWW38D1l6WbTZin0ct+aA==",
|
"integrity": "sha512-PTVuCrCkZkVPoo+l0+9PVFyP9frLp/L3FUtQDtAaN+ERuqx97DNF20tIH8khSvnXrkKv3lTJ/5iFWddy+dTAwg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cross-fetch": "^3.1.5"
|
"cross-fetch": "^3.1.5"
|
||||||
},
|
},
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
"typecheck:watch": "tsc --noEmit --watch"
|
"typecheck:watch": "tsc --noEmit --watch"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@authorizerdev/authorizer-js": "1.2.11",
|
"@authorizerdev/authorizer-js": "2.0.0",
|
||||||
"@solid-primitives/pagination": "0.2.10",
|
"@solid-primitives/pagination": "0.2.10",
|
||||||
"cropperjs": "1.6.1",
|
"cropperjs": "1.6.1",
|
||||||
"form-data": "4.0.0",
|
"form-data": "4.0.0",
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import type { AuthModalSearchParams } from './types'
|
import type { AuthModalSearchParams } from './types'
|
||||||
|
|
||||||
|
import { ApiResponse, ForgotPasswordResponse } from '@authorizerdev/authorizer-js'
|
||||||
import { clsx } from 'clsx'
|
import { clsx } from 'clsx'
|
||||||
import { createSignal, JSX, Show } from 'solid-js'
|
import { createSignal, JSX, Show } from 'solid-js'
|
||||||
|
|
||||||
|
@ -57,23 +58,17 @@ export const ForgotPasswordForm = () => {
|
||||||
|
|
||||||
setIsSubmitting(true)
|
setIsSubmitting(true)
|
||||||
try {
|
try {
|
||||||
const response = await authorizer().forgotPassword({
|
const response: ApiResponse<ForgotPasswordResponse> = await authorizer().forgotPassword({
|
||||||
email: email(),
|
email: email(),
|
||||||
redirect_uri: window.location.origin,
|
redirect_uri: window.location.origin,
|
||||||
})
|
})
|
||||||
console.debug('[ForgotPasswordForm] authorizer response:', response)
|
console.debug('[ForgotPasswordForm] authorizer response:', response)
|
||||||
if (response && response.message) {
|
if (response && response.data.message) {
|
||||||
setMessage(response.message)
|
setMessage(response.data.message)
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
||||||
// @ts-ignore
|
|
||||||
response.errors &&
|
response.errors &&
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
||||||
// @ts-ignore
|
|
||||||
response.errors.length > 0 &&
|
response.errors.length > 0 &&
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
||||||
// @ts-ignore
|
|
||||||
response.errors[0].message.includes('bad user credentials')
|
response.errors[0].message.includes('bad user credentials')
|
||||||
) {
|
) {
|
||||||
setIsUserNotFound(true)
|
setIsUserNotFound(true)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user