fix: return clear error when social auth provider is not configured

This commit is contained in:
Rotimi Best
2026-06-14 09:56:30 +01:00
parent 64571dd5ec
commit ee4d4922d6
13 changed files with 41 additions and 14 deletions
@@ -6,6 +6,7 @@
import { currentOrg } from '$lib/utils/store/org';
import { GoogleIconColored } from '$features/ui/icons';
import { authClient } from '$lib/utils/services/auth/client';
import { snackbar } from '$features/ui/snackbar/store';
import * as Card from '@cio/ui/base/card';
import { Button } from '@cio/ui/base/button';
import { Separator } from '@cio/ui/base/separator';
@@ -51,17 +52,16 @@
const redirectTo = `${window.location.origin + pathname}`;
const errorCallbackURL = `${window.location.origin + ROUTE.AUTH_FAILED}`;
console.log({ redirectTo });
try {
console.log('signInWithGoogle');
const data = await authClient.signIn.social({
const result = await authClient.signIn.social({
provider: 'google',
callbackURL: redirectTo,
errorCallbackURL: errorCallbackURL
});
console.log('data', data);
if (result?.error) {
snackbar.error('snackbar.social_auth_not_enabled');
}
} catch (error) {
console.log('catch error', error);
}