mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2025-03-04 04:15:34 +01:00
google callback error handling
This commit is contained in:
parent
a26499431f
commit
da5dea533e
@ -539,5 +539,8 @@
|
|||||||
},
|
},
|
||||||
"registration.callback.waiting.description": {
|
"registration.callback.waiting.description": {
|
||||||
"defaultMessage": "Bitte warten Sie, während wir Ihre Identität überprüfen"
|
"defaultMessage": "Bitte warten Sie, während wir Ihre Identität überprüfen"
|
||||||
|
},
|
||||||
|
"registation.callback.error.message": {
|
||||||
|
"defaultMessage": "Beim Überprüfen Ihrer Identität bei Google ist ein Fehler aufgetreten. Sie können es auf der Anmeldeseite erneut versuchen"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -535,6 +535,9 @@
|
|||||||
},
|
},
|
||||||
"registration.callback.waiting.description": {
|
"registration.callback.waiting.description": {
|
||||||
"defaultMessage": "Please wait while we validate your identity"
|
"defaultMessage": "Please wait while we validate your identity"
|
||||||
|
},
|
||||||
|
"registation.callback.error.message": {
|
||||||
|
"defaultMessage": "An error occurred validating your identity with Google, you can try again from the login page"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -515,5 +515,8 @@
|
|||||||
},
|
},
|
||||||
"registration.callback.waiting.description": {
|
"registration.callback.waiting.description": {
|
||||||
"defaultMessage": "Por favor espera mientras validamos tu identidad"
|
"defaultMessage": "Por favor espera mientras validamos tu identidad"
|
||||||
|
},
|
||||||
|
"registation.callback.error.message": {
|
||||||
|
"defaultMessage": "Ocurrió un error al validar tu identidad con Google, puedes volver a intentarlo desde la página de inicio de sesión"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -542,5 +542,8 @@
|
|||||||
},
|
},
|
||||||
"registration.callback.waiting.description": {
|
"registration.callback.waiting.description": {
|
||||||
"defaultMessage": "Veuillez patienter pendant que nous validons votre identité"
|
"defaultMessage": "Veuillez patienter pendant que nous validons votre identité"
|
||||||
|
},
|
||||||
|
"registation.callback.error.message": {
|
||||||
|
"defaultMessage": "Une erreur s'est produite lors de la validation de votre identité auprès de Google, vous pouvez réessayer depuis la page de connexion"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -509,5 +509,8 @@
|
|||||||
},
|
},
|
||||||
"registration.callback.waiting.description": {
|
"registration.callback.waiting.description": {
|
||||||
"defaultMessage": "Подождите, пока мы подтвердим вашу личность"
|
"defaultMessage": "Подождите, пока мы подтвердим вашу личность"
|
||||||
|
},
|
||||||
|
"registation.callback.error.message": {
|
||||||
|
"defaultMessage": "Произошла ошибка при подтверждении вашей личности в Google. Повторите попытку со страницы входа."
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -536,5 +536,8 @@
|
|||||||
},
|
},
|
||||||
"registration.callback.waiting.description": {
|
"registration.callback.waiting.description": {
|
||||||
"defaultMessage": "我们正在验证您的身份,请稍候"
|
"defaultMessage": "我们正在验证您的身份,请稍候"
|
||||||
|
},
|
||||||
|
"registation.callback.error.message": {
|
||||||
|
"defaultMessage": "使用 Google 验证您的身份时出错,您可以从登录页面重试"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -915,6 +915,12 @@
|
|||||||
"value": "Veröffentlichen"
|
"value": "Veröffentlichen"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"registation.callback.error.message": [
|
||||||
|
{
|
||||||
|
"type": 0,
|
||||||
|
"value": "Beim Überprüfen Ihrer Identität bei Google ist ein Fehler aufgetreten. Sie können es auf der Anmeldeseite erneut versuchen"
|
||||||
|
}
|
||||||
|
],
|
||||||
"registation.success-title": [
|
"registation.success-title": [
|
||||||
{
|
{
|
||||||
"type": 0,
|
"type": 0,
|
||||||
|
@ -907,6 +907,12 @@
|
|||||||
"value": "Publish"
|
"value": "Publish"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"registation.callback.error.message": [
|
||||||
|
{
|
||||||
|
"type": 0,
|
||||||
|
"value": "An error occurred validating your identity with Google, you can try again from the login page"
|
||||||
|
}
|
||||||
|
],
|
||||||
"registation.success-title": [
|
"registation.success-title": [
|
||||||
{
|
{
|
||||||
"type": 0,
|
"type": 0,
|
||||||
|
@ -861,6 +861,12 @@
|
|||||||
"value": "Publicar"
|
"value": "Publicar"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"registation.callback.error.message": [
|
||||||
|
{
|
||||||
|
"type": 0,
|
||||||
|
"value": "Ocurrió un error al validar tu identidad con Google, puedes volver a intentarlo desde la página de inicio de sesión"
|
||||||
|
}
|
||||||
|
],
|
||||||
"registation.success-title": [
|
"registation.success-title": [
|
||||||
{
|
{
|
||||||
"type": 0,
|
"type": 0,
|
||||||
|
@ -907,6 +907,12 @@
|
|||||||
"value": "Publier"
|
"value": "Publier"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"registation.callback.error.message": [
|
||||||
|
{
|
||||||
|
"type": 0,
|
||||||
|
"value": "Une erreur s'est produite lors de la validation de votre identité auprès de Google, vous pouvez réessayer depuis la page de connexion"
|
||||||
|
}
|
||||||
|
],
|
||||||
"registation.success-title": [
|
"registation.success-title": [
|
||||||
{
|
{
|
||||||
"type": 0,
|
"type": 0,
|
||||||
|
@ -855,6 +855,12 @@
|
|||||||
"value": "Опубликовать"
|
"value": "Опубликовать"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"registation.callback.error.message": [
|
||||||
|
{
|
||||||
|
"type": 0,
|
||||||
|
"value": "Произошла ошибка при подтверждении вашей личности в Google. Повторите попытку со страницы входа."
|
||||||
|
}
|
||||||
|
],
|
||||||
"registation.success-title": [
|
"registation.success-title": [
|
||||||
{
|
{
|
||||||
"type": 0,
|
"type": 0,
|
||||||
|
@ -903,6 +903,12 @@
|
|||||||
"value": "发布"
|
"value": "发布"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"registation.callback.error.message": [
|
||||||
|
{
|
||||||
|
"type": 0,
|
||||||
|
"value": "使用 Google 验证您的身份时出错,您可以从登录页面重试"
|
||||||
|
}
|
||||||
|
],
|
||||||
"registation.success-title": [
|
"registation.success-title": [
|
||||||
{
|
{
|
||||||
"type": 0,
|
"type": 0,
|
||||||
|
@ -13,6 +13,7 @@ import { activeInstance } from '../../redux/clientSlice';
|
|||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { css } from '@emotion/react';
|
import { css } from '@emotion/react';
|
||||||
import { CircularProgress } from '@mui/material';
|
import { CircularProgress } from '@mui/material';
|
||||||
|
import GlobalError from '../form/global-error';
|
||||||
|
|
||||||
const RegistrationCallbackPage = (): React.ReactElement => {
|
const RegistrationCallbackPage = (): React.ReactElement => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
@ -21,6 +22,7 @@ const RegistrationCallbackPage = (): React.ReactElement => {
|
|||||||
const [email, setEmail] = useState(undefined);
|
const [email, setEmail] = useState(undefined);
|
||||||
const [syncCode, setSyncCode] = useState(undefined);
|
const [syncCode, setSyncCode] = useState(undefined);
|
||||||
const [googleSync, setGoogleSync] = useState(undefined);
|
const [googleSync, setGoogleSync] = useState(undefined);
|
||||||
|
const [callbackError, setCallbackError] = useState(false);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -50,14 +52,10 @@ const RegistrationCallbackPage = (): React.ReactElement => {
|
|||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log('ERROR', error);
|
console.log('ERROR', error);
|
||||||
|
setCallbackError(true);
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const buttonsStyle = css({
|
|
||||||
marginLeft: '10px',
|
|
||||||
marginRight: '10px',
|
|
||||||
});
|
|
||||||
|
|
||||||
const confirmAccountSynching = () => {
|
const confirmAccountSynching = () => {
|
||||||
client
|
client
|
||||||
.confirmAccountSync(email, syncCode)
|
.confirmAccountSync(email, syncCode)
|
||||||
@ -69,8 +67,13 @@ const RegistrationCallbackPage = (): React.ReactElement => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const buttonsStyle = css({
|
||||||
|
marginLeft: '10px',
|
||||||
|
marginRight: '10px',
|
||||||
|
});
|
||||||
|
|
||||||
// if service reports that user doesnt sync accounts yet, we need to show the options
|
// if service reports that user doesnt sync accounts yet, we need to show the options
|
||||||
const needConfirmLinking = email && !googleSync;
|
const needConfirmLinking = !callbackError && email && !googleSync;
|
||||||
const titleKey = needConfirmLinking
|
const titleKey = needConfirmLinking
|
||||||
? 'registration.callback.confirm.title'
|
? 'registration.callback.confirm.title'
|
||||||
: 'registration.callback.waiting.title';
|
: 'registration.callback.waiting.title';
|
||||||
@ -93,7 +96,32 @@ const RegistrationCallbackPage = (): React.ReactElement => {
|
|||||||
<FormattedMessage id={descriptionKey} defaultMessage={descriptionDefaultValue} />
|
<FormattedMessage id={descriptionKey} defaultMessage={descriptionDefaultValue} />
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
{!needConfirmLinking && <CircularProgress />}
|
{callbackError && (
|
||||||
|
<>
|
||||||
|
<GlobalError
|
||||||
|
error={{
|
||||||
|
msg: intl.formatMessage({
|
||||||
|
id: 'registation.callback.error.message',
|
||||||
|
defaultMessage:
|
||||||
|
'An error occurred validating your identity with Google, you can try again from the login page',
|
||||||
|
}),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
color="primary"
|
||||||
|
size="medium"
|
||||||
|
variant="contained"
|
||||||
|
component={RouterLink}
|
||||||
|
to="/c/login"
|
||||||
|
disableElevation={true}
|
||||||
|
css={buttonsStyle}
|
||||||
|
>
|
||||||
|
<FormattedMessage id="registration.callback.back" defaultMessage="Back to login" />
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{!needConfirmLinking && !callbackError && <CircularProgress />}
|
||||||
|
|
||||||
{needConfirmLinking && (
|
{needConfirmLinking && (
|
||||||
<>
|
<>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user