mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-10-15 23:55:43 -04:00
fix(native): report SSO sign-in failures
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
13 files changed
+133
-9
No files matched your search
@@ -73,6 +73,34 @@ export default function LoginScreen() {
|
|||||||
|
|
||||||
const isSubmitting = useStore(form.store, (s) => s.isSubmitting);
|
const isSubmitting = useStore(form.store, (s) => s.isSubmitting);
|
||||||
const busy = isSubmitting || isSignedIn;
|
const busy = isSubmitting || isSignedIn;
|
||||||
|
const [isSsoPending, setSsoPending] = useState(false);
|
||||||
|
|
||||||
|
const signInWithSso = async () => {
|
||||||
|
if (isSsoPending) return;
|
||||||
|
setSsoPending(true);
|
||||||
|
try {
|
||||||
|
const result = await authClient.signIn.social({
|
||||||
|
provider: "oidc",
|
||||||
|
callbackURL: "/(tabs)/(home)",
|
||||||
|
// Same prefix as callbackURL so the auth session also closes on failure (Android matches by prefix).
|
||||||
|
errorCallbackURL: "/(tabs)/(home)",
|
||||||
|
});
|
||||||
|
if (result.error) {
|
||||||
|
toast.error(getAuthErrorMessage(result.error, t`Couldn't start sign-in`));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// The Expo plugin stores the session cookie when the browser returns successfully; if no
|
||||||
|
// session appeared, the flow was cancelled or failed at the provider.
|
||||||
|
const session = await authClient.getSession();
|
||||||
|
if (!session.data) {
|
||||||
|
toast.error(t`Sign-in didn't complete`);
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
toast.error(t`Couldn't start sign-in`);
|
||||||
|
} finally {
|
||||||
|
setSsoPending(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const statusCompletedColor = useCSSVariable("--color-status-completed") as string;
|
const statusCompletedColor = useCSSVariable("--color-status-completed") as string;
|
||||||
const serverHost = splitUrl(getServerUrl()).host;
|
const serverHost = splitUrl(getServerUrl()).host;
|
||||||
@@ -99,18 +127,18 @@ export default function LoginScreen() {
|
|||||||
return (
|
return (
|
||||||
<Animated.View entering={FadeInDown.duration(300).delay(100)} className="mb-4">
|
<Animated.View entering={FadeInDown.duration(300).delay(100)} className="mb-4">
|
||||||
<Button
|
<Button
|
||||||
onPress={() => {
|
onPress={() => void signInWithSso()}
|
||||||
authClient.signIn.social({
|
disabled={busy || isSsoPending}
|
||||||
provider: "oidc",
|
|
||||||
callbackURL: "/(tabs)/(home)",
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
className="w-full"
|
className="w-full"
|
||||||
>
|
>
|
||||||
<ButtonLabel>
|
{isSsoPending ? (
|
||||||
<Trans>Sign in with {providerName}</Trans>
|
<Spinner size="sm" />
|
||||||
</ButtonLabel>
|
) : (
|
||||||
|
<ButtonLabel>
|
||||||
|
<Trans>Sign in with {providerName}</Trans>
|
||||||
|
</ButtonLabel>
|
||||||
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{showPasswordLogin && (
|
{showPasswordLogin && (
|
||||||
|
|||||||
@@ -887,6 +887,10 @@ msgstr ""
|
|||||||
msgid "Couldn't search right now"
|
msgid "Couldn't search right now"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Couldn't start sign-in"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
||||||
msgid "Crash reporting"
|
msgid "Crash reporting"
|
||||||
msgstr "الإبلاغ عن الأعطال"
|
msgstr "الإبلاغ عن الأعطال"
|
||||||
@@ -3191,6 +3195,10 @@ msgstr "تسجيل الخروج"
|
|||||||
msgid "Sign out of other sessions"
|
msgid "Sign out of other sessions"
|
||||||
msgstr "تسجيل الخروج من الجلسات الأخرى"
|
msgstr "تسجيل الخروج من الجلسات الأخرى"
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Sign-in didn't complete"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/web/src/routes/_app/onboarding.tsx
|
#: apps/web/src/routes/_app/onboarding.tsx
|
||||||
msgid "Skip for now"
|
msgid "Skip for now"
|
||||||
msgstr "تخطي في الوقت الحالي"
|
msgstr "تخطي في الوقت الحالي"
|
||||||
|
|||||||
@@ -887,6 +887,10 @@ msgstr ""
|
|||||||
msgid "Couldn't search right now"
|
msgid "Couldn't search right now"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Couldn't start sign-in"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
||||||
msgid "Crash reporting"
|
msgid "Crash reporting"
|
||||||
msgstr "Absturzberichte"
|
msgstr "Absturzberichte"
|
||||||
@@ -3191,6 +3195,10 @@ msgstr "Abmelden"
|
|||||||
msgid "Sign out of other sessions"
|
msgid "Sign out of other sessions"
|
||||||
msgstr "Von anderen Sitzungen abmelden"
|
msgstr "Von anderen Sitzungen abmelden"
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Sign-in didn't complete"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/web/src/routes/_app/onboarding.tsx
|
#: apps/web/src/routes/_app/onboarding.tsx
|
||||||
msgid "Skip for now"
|
msgid "Skip for now"
|
||||||
msgstr "Vorerst überspringen"
|
msgstr "Vorerst überspringen"
|
||||||
|
|||||||
@@ -887,6 +887,10 @@ msgstr "Couldn't load your watch history"
|
|||||||
msgid "Couldn't search right now"
|
msgid "Couldn't search right now"
|
||||||
msgstr "Couldn't search right now"
|
msgstr "Couldn't search right now"
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Couldn't start sign-in"
|
||||||
|
msgstr "Couldn't start sign-in"
|
||||||
|
|
||||||
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
||||||
msgid "Crash reporting"
|
msgid "Crash reporting"
|
||||||
msgstr "Crash reporting"
|
msgstr "Crash reporting"
|
||||||
@@ -3191,6 +3195,10 @@ msgstr ""
|
|||||||
msgid "Sign out of other sessions"
|
msgid "Sign out of other sessions"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Sign-in didn't complete"
|
||||||
|
msgstr "Sign-in didn't complete"
|
||||||
|
|
||||||
#: apps/web/src/routes/_app/onboarding.tsx
|
#: apps/web/src/routes/_app/onboarding.tsx
|
||||||
msgid "Skip for now"
|
msgid "Skip for now"
|
||||||
msgstr "Skip for now"
|
msgstr "Skip for now"
|
||||||
|
|||||||
@@ -887,6 +887,10 @@ msgstr ""
|
|||||||
msgid "Couldn't search right now"
|
msgid "Couldn't search right now"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Couldn't start sign-in"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
||||||
msgid "Crash reporting"
|
msgid "Crash reporting"
|
||||||
msgstr "Informe de fallos"
|
msgstr "Informe de fallos"
|
||||||
@@ -3191,6 +3195,10 @@ msgstr "Cerrar sesión"
|
|||||||
msgid "Sign out of other sessions"
|
msgid "Sign out of other sessions"
|
||||||
msgstr "Cerrar otras sesiones"
|
msgstr "Cerrar otras sesiones"
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Sign-in didn't complete"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/web/src/routes/_app/onboarding.tsx
|
#: apps/web/src/routes/_app/onboarding.tsx
|
||||||
msgid "Skip for now"
|
msgid "Skip for now"
|
||||||
msgstr "Omitir por ahora"
|
msgstr "Omitir por ahora"
|
||||||
|
|||||||
@@ -887,6 +887,10 @@ msgstr ""
|
|||||||
msgid "Couldn't search right now"
|
msgid "Couldn't search right now"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Couldn't start sign-in"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
||||||
msgid "Crash reporting"
|
msgid "Crash reporting"
|
||||||
msgstr "Signalement de plantages"
|
msgstr "Signalement de plantages"
|
||||||
@@ -3191,6 +3195,10 @@ msgstr "Se déconnecter"
|
|||||||
msgid "Sign out of other sessions"
|
msgid "Sign out of other sessions"
|
||||||
msgstr "Se déconnecter des autres sessions"
|
msgstr "Se déconnecter des autres sessions"
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Sign-in didn't complete"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/web/src/routes/_app/onboarding.tsx
|
#: apps/web/src/routes/_app/onboarding.tsx
|
||||||
msgid "Skip for now"
|
msgid "Skip for now"
|
||||||
msgstr "Passer pour l'instant"
|
msgstr "Passer pour l'instant"
|
||||||
|
|||||||
@@ -887,6 +887,10 @@ msgstr ""
|
|||||||
msgid "Couldn't search right now"
|
msgid "Couldn't search right now"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Couldn't start sign-in"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
||||||
msgid "Crash reporting"
|
msgid "Crash reporting"
|
||||||
msgstr "דיווח על קריסות"
|
msgstr "דיווח על קריסות"
|
||||||
@@ -3191,6 +3195,10 @@ msgstr "התנתק"
|
|||||||
msgid "Sign out of other sessions"
|
msgid "Sign out of other sessions"
|
||||||
msgstr "התנתק משאר ההפעלות"
|
msgstr "התנתק משאר ההפעלות"
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Sign-in didn't complete"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/web/src/routes/_app/onboarding.tsx
|
#: apps/web/src/routes/_app/onboarding.tsx
|
||||||
msgid "Skip for now"
|
msgid "Skip for now"
|
||||||
msgstr "דלג לעת עתה"
|
msgstr "דלג לעת עתה"
|
||||||
|
|||||||
@@ -887,6 +887,10 @@ msgstr ""
|
|||||||
msgid "Couldn't search right now"
|
msgid "Couldn't search right now"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Couldn't start sign-in"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
||||||
msgid "Crash reporting"
|
msgid "Crash reporting"
|
||||||
msgstr "Segnalazione degli arresti anomali"
|
msgstr "Segnalazione degli arresti anomali"
|
||||||
@@ -3191,6 +3195,10 @@ msgstr "Esci"
|
|||||||
msgid "Sign out of other sessions"
|
msgid "Sign out of other sessions"
|
||||||
msgstr "Esci dalle altre sessioni"
|
msgstr "Esci dalle altre sessioni"
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Sign-in didn't complete"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/web/src/routes/_app/onboarding.tsx
|
#: apps/web/src/routes/_app/onboarding.tsx
|
||||||
msgid "Skip for now"
|
msgid "Skip for now"
|
||||||
msgstr "Salta per ora"
|
msgstr "Salta per ora"
|
||||||
|
|||||||
@@ -887,6 +887,10 @@ msgstr ""
|
|||||||
msgid "Couldn't search right now"
|
msgid "Couldn't search right now"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Couldn't start sign-in"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
||||||
msgid "Crash reporting"
|
msgid "Crash reporting"
|
||||||
msgstr "クラッシュレポート"
|
msgstr "クラッシュレポート"
|
||||||
@@ -3191,6 +3195,10 @@ msgstr "サインアウト"
|
|||||||
msgid "Sign out of other sessions"
|
msgid "Sign out of other sessions"
|
||||||
msgstr "他のセッションからサインアウト"
|
msgstr "他のセッションからサインアウト"
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Sign-in didn't complete"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/web/src/routes/_app/onboarding.tsx
|
#: apps/web/src/routes/_app/onboarding.tsx
|
||||||
msgid "Skip for now"
|
msgid "Skip for now"
|
||||||
msgstr "今はスキップ"
|
msgstr "今はスキップ"
|
||||||
|
|||||||
@@ -887,6 +887,10 @@ msgstr ""
|
|||||||
msgid "Couldn't search right now"
|
msgid "Couldn't search right now"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Couldn't start sign-in"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
||||||
msgid "Crash reporting"
|
msgid "Crash reporting"
|
||||||
msgstr "충돌 보고"
|
msgstr "충돌 보고"
|
||||||
@@ -3191,6 +3195,10 @@ msgstr "로그아웃"
|
|||||||
msgid "Sign out of other sessions"
|
msgid "Sign out of other sessions"
|
||||||
msgstr "다른 세션에서 로그아웃"
|
msgstr "다른 세션에서 로그아웃"
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Sign-in didn't complete"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/web/src/routes/_app/onboarding.tsx
|
#: apps/web/src/routes/_app/onboarding.tsx
|
||||||
msgid "Skip for now"
|
msgid "Skip for now"
|
||||||
msgstr "지금은 건너뛰기"
|
msgstr "지금은 건너뛰기"
|
||||||
|
|||||||
@@ -887,6 +887,10 @@ msgstr ""
|
|||||||
msgid "Couldn't search right now"
|
msgid "Couldn't search right now"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Couldn't start sign-in"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
||||||
msgid "Crash reporting"
|
msgid "Crash reporting"
|
||||||
msgstr "Crashrapportage"
|
msgstr "Crashrapportage"
|
||||||
@@ -3191,6 +3195,10 @@ msgstr "Afmelden"
|
|||||||
msgid "Sign out of other sessions"
|
msgid "Sign out of other sessions"
|
||||||
msgstr "Andere sessies afmelden"
|
msgstr "Andere sessies afmelden"
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Sign-in didn't complete"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/web/src/routes/_app/onboarding.tsx
|
#: apps/web/src/routes/_app/onboarding.tsx
|
||||||
msgid "Skip for now"
|
msgid "Skip for now"
|
||||||
msgstr "Nu overslaan"
|
msgstr "Nu overslaan"
|
||||||
|
|||||||
@@ -887,6 +887,10 @@ msgstr ""
|
|||||||
msgid "Couldn't search right now"
|
msgid "Couldn't search right now"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Couldn't start sign-in"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
||||||
msgid "Crash reporting"
|
msgid "Crash reporting"
|
||||||
msgstr "Relatório de falhas"
|
msgstr "Relatório de falhas"
|
||||||
@@ -3191,6 +3195,10 @@ msgstr "Sair"
|
|||||||
msgid "Sign out of other sessions"
|
msgid "Sign out of other sessions"
|
||||||
msgstr "Sair de outras sessões"
|
msgstr "Sair de outras sessões"
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Sign-in didn't complete"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/web/src/routes/_app/onboarding.tsx
|
#: apps/web/src/routes/_app/onboarding.tsx
|
||||||
msgid "Skip for now"
|
msgid "Skip for now"
|
||||||
msgstr "Ignorar por agora"
|
msgstr "Ignorar por agora"
|
||||||
|
|||||||
@@ -887,6 +887,10 @@ msgstr ""
|
|||||||
msgid "Couldn't search right now"
|
msgid "Couldn't search right now"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Couldn't start sign-in"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
#: apps/native/src/app/(tabs)/(settings)/index.tsx
|
||||||
msgid "Crash reporting"
|
msgid "Crash reporting"
|
||||||
msgstr "崩溃报告"
|
msgstr "崩溃报告"
|
||||||
@@ -3191,6 +3195,10 @@ msgstr "退出登录"
|
|||||||
msgid "Sign out of other sessions"
|
msgid "Sign out of other sessions"
|
||||||
msgstr "退出其他会话"
|
msgstr "退出其他会话"
|
||||||
|
|
||||||
|
#: apps/native/src/app/(auth)/login.tsx
|
||||||
|
msgid "Sign-in didn't complete"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/web/src/routes/_app/onboarding.tsx
|
#: apps/web/src/routes/_app/onboarding.tsx
|
||||||
msgid "Skip for now"
|
msgid "Skip for now"
|
||||||
msgstr "暂时跳过"
|
msgstr "暂时跳过"
|
||||||
|
|||||||
Reference in new issue
Block a user