Skip to content

Commit 883ac10

Browse files
authored
fix: android redirect (calcom#25888)
* fix android redirect * remove logs
1 parent d13adc8 commit 883ac10

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

companion/app/oauth/callback.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
import React, { useEffect } from "react";
22
import { View, Text, ActivityIndicator, Platform } from "react-native";
33
import { useRouter, useLocalSearchParams } from "expo-router";
4+
import { useAuth } from "../../contexts";
45

56
export default function OAuthCallback() {
67
const router = useRouter();
78
const params = useLocalSearchParams();
9+
const auth = useAuth();
810

911
useEffect(() => {
12+
if (Platform.OS === "android") {
13+
if (auth.userInfo) {
14+
router.replace("/(tabs)");
15+
}
16+
}
17+
1018
if (Platform.OS !== "web") return;
1119

1220
// Extract code, state, and error parameters from URL

0 commit comments

Comments
 (0)