diff --git a/front/views/AuthenticationView.tsx b/front/views/AuthenticationView.tsx index 9e57b35..7f63779 100644 --- a/front/views/AuthenticationView.tsx +++ b/front/views/AuthenticationView.tsx @@ -8,6 +8,7 @@ import SigninForm from '../components/forms/signinform'; import SignupForm from '../components/forms/signupform'; import TextButton from '../components/TextButton'; import { RouteProps, useNavigation } from '../Navigation'; +import * as Linking from 'expo-linking'; const hanldeSignin = async ( username: string, @@ -61,7 +62,7 @@ const AuthenticationView = ({ isSignup }: RouteProps) = variant="outline" marginTop={5} colorScheme="primary" - onPress={() => (window.location.href = `${baseAPIUrl}/auth/login/google`)} + onPress={() => Linking.openURL(`${baseAPIUrl}/auth/login/google`)} /> {mode === 'signin' ? ( { const dispatch = useDispatch(); + const route = useRoute(); useEffect(() => { + const params = route.path?.replace('/logged/google', ''); async function run() { const accessToken = await API.fetch({ - route: `/auth/logged/google${window.location.search}`, + route: `/auth/logged/google${params}`, method: 'GET', }).then((responseBody) => responseBody.access_token as AccessToken); dispatch(setAccessToken(accessToken)); @@ -17,7 +21,7 @@ const GoogleView = () => { run(); }, []); - return

Loading please wait

; + return Loading please wait; }; export default GoogleView;