diff --git a/src/components/comment/CommentTextBlock/styles.module.scss b/src/components/comment/CommentTextBlock/styles.module.scss index f42e2ef7..ec47d8fd 100644 --- a/src/components/comment/CommentTextBlock/styles.module.scss +++ b/src/components/comment/CommentTextBlock/styles.module.scss @@ -28,15 +28,4 @@ :global(.green) { color: $wisegreen; } - - //&:last-child { - // p { - // &::after { - // content: ''; - // display: inline-flex; - // height: 1em; - // width: 150px; - // } - // } - //} } diff --git a/src/redux/auth/sagas.ts b/src/redux/auth/sagas.ts index f0cbebd5..8f029a01 100644 --- a/src/redux/auth/sagas.ts +++ b/src/redux/auth/sagas.ts @@ -57,6 +57,7 @@ import { ERRORS } from '~/constants/errors'; import { messagesSet } from '~/redux/messages/actions'; import { SagaIterator } from 'redux-saga'; import { isEmpty } from 'ramda'; +import { AxiosError } from 'axios'; function* setTokenSaga({ token }: ReturnType) { localStorage.setItem('token', token); @@ -341,13 +342,6 @@ function* loginWithSocial({ token }: ReturnType) { token, }); - // Backend asks us for account registration - if (data?.needs_register) { - yield put(authSetRegisterSocial({ token })); - yield put(modalShowDialog(DIALOGS.LOGIN_SOCIAL_REGISTER)); - return; - } - if (data.token) { yield put(authSetToken(data.token)); yield call(refreshUser); @@ -355,6 +349,15 @@ function* loginWithSocial({ token }: ReturnType) { return; } } catch (error) { + const data = (error as AxiosError<{ needs_register: boolean }>).response?.data; + + // Backend asks us for account registration + if (data?.needs_register) { + yield put(authSetRegisterSocial({ token })); + yield put(modalShowDialog(DIALOGS.LOGIN_SOCIAL_REGISTER)); + return; + } + yield put(userSetLoginError(error.message)); } }