Handle email validation error from server
This commit is contained in:
@@ -114,8 +114,21 @@ function Inner() {
|
|||||||
|
|
||||||
setSuccess(true)
|
setSuccess(true)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const {clean} = cleanError(e)
|
const {clean, raw} = cleanError(e)
|
||||||
|
|
||||||
|
if (clean) {
|
||||||
setError(clean || _(msg`Something went wrong, please try again`))
|
setError(clean || _(msg`Something went wrong, please try again`))
|
||||||
|
} else {
|
||||||
|
let message = _(msg`Something went wrong, please try again`)
|
||||||
|
|
||||||
|
if (raw) {
|
||||||
|
if (raw.startsWith('This email address is not supported')) {
|
||||||
|
message = _(msg`Please enter a valid, non-temporary email address.`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setError(message)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -207,4 +207,4 @@ export const PUBLIC_APPVIEW_DID = 'did:web:api.bsky.app'
|
|||||||
export const PUBLIC_STAGING_APPVIEW_DID = 'did:web:api.staging.bsky.dev'
|
export const PUBLIC_STAGING_APPVIEW_DID = 'did:web:api.staging.bsky.dev'
|
||||||
|
|
||||||
export const DEV_ENV_APPVIEW = `http://localhost:2584` // always the same
|
export const DEV_ENV_APPVIEW = `http://localhost:2584` // always the same
|
||||||
export const DEV_ENV_APPVIEW_DID = `did:plc:cs5onzby6e5yv25qfhtiatsa` // get this from `localhost:2581`
|
export const DEV_ENV_APPVIEW_DID = `did:plc:lmynpbfp7bbyc4pz2xjdtzsh` // get this from `localhost:2581`
|
||||||
|
|||||||
Reference in New Issue
Block a user