Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

fix: blank page after sign up

Blue Mousecd1aeae821be
diff --git a/src/components/GoogleAuth.tsx b/src/components/GoogleAuth.tsx
index 153845d16..d3b75c7b6 100644
--- a/src/components/GoogleAuth.tsx
+++ b/src/components/GoogleAuth.tsx
@@ -6,18 +6,19 @@ import GoogleGSVG from 'ui/icons/GoogleG'
interface IGoogleAuth {
setIsLoading: (isLoading: boolean) => void,
+ callback: any, // TODO add types
authSSO: any, // TODO add types
dontRemember?: boolean,
}
-const GoogleAuth: React.FC<IGoogleAuth> = ({ setIsLoading, authSSO, dontRemember }) => {
+const GoogleAuth: React.FC<IGoogleAuth> = ({
+ setIsLoading, authSSO, dontRemember, callback,
+}) => {
const { t } = useTranslation()
const googleLogin = async () => {
setIsLoading(true)
- authSSO(dontRemember, t, () => {
- setIsLoading(false)
- })
+ authSSO(dontRemember, t, callback)
}
return (
diff --git a/src/pages/Auth/Signup/Signup.tsx b/src/pages/Auth/Signup/Signup.tsx
index 80d731bcf..20a914f40 100644
--- a/src/pages/Auth/Signup/Signup.tsx
+++ b/src/pages/Auth/Signup/Signup.tsx
@@ -101,6 +101,14 @@ const Signup = ({ signup, authSSO }: {
validate()
}, [form]) // eslint-disable-line
+ const signUpCallback = (result: any) => {
+ if (result) {
+ trackCustom('SIGNUP')
+ } else {
+ setIsLoading(false)
+ }
+ }
+
const onSubmit = (data: {
email: string,
password: string,
@@ -111,13 +119,7 @@ const Signup = ({ signup, authSSO }: {
}) => {
if (!isLoading) {
setIsLoading(true)
- signup(_omit(data, 'tos'), t, (result) => {
- if (result) {
- trackCustom('SIGNUP')
- } else {
- setIsLoading(false)
- }
- })
+ signup(_omit(data, 'tos'), t, signUpCallback)
}
}
@@ -251,7 +253,7 @@ const Signup = ({ signup, authSSO }: {
{t('auth.signup.button')}
</Button>
</div>
- <GoogleAuth setIsLoading={setIsLoading} authSSO={authSSO} dontRemember={form.dontRemember} />
+ <GoogleAuth setIsLoading={setIsLoading} authSSO={authSSO} callback={signUpCallback} dontRemember={form.dontRemember} />
</form>
</div>
</Title>
diff --git a/src/redux/sagas/auth/workers/sso_auth.ts b/src/redux/sagas/auth/workers/sso_auth.ts
index d901e35f0..caee8ce53 100644
--- a/src/redux/sagas/auth/workers/sso_auth.ts
+++ b/src/redux/sagas/auth/workers/sso_auth.ts
@@ -1,6 +1,5 @@
import { call, put, delay } from 'redux-saga/effects'
-import UIActions from 'redux/reducers/ui'
import { authActions } from 'redux/reducers/auth'
import { errorsActions } from 'redux/reducers/errors'
import { setAccessToken } from 'utils/accessToken'
@@ -65,7 +64,7 @@ export default function* ssoAuth({ payload: { callback, dontRemember } }: any) {
yield put(authActions.loginSuccessful(user))
yield call(setAccessToken, accessToken, dontRemember)
yield call(setRefreshToken, refreshToken)
- yield put(UIActions.setThemeType(user.theme))
+ // yield put(UIActions.setThemeType(user.theme))
yield put(sagaActions.loadProjects())
yield put(sagaActions.loadSharedProjects())
yield put(sagaActions.loadProjectAlerts())