diff --git a/src/client/api/authjs/useAuth.ts b/src/client/api/authjs/useAuth.ts
index 083489b..bcebeab 100644
--- a/src/client/api/authjs/useAuth.ts
+++ b/src/client/api/authjs/useAuth.ts
@@ -39,31 +39,33 @@ export function useAuth() {
}
);
- const loginWithOAuth = useEvent(async (provider: BuiltInProviderType) => {
- let res: SignInResponse | undefined;
- try {
- res = await signIn(provider, {
- redirect: false,
- });
- console.log('res', res);
- } catch (err) {
- toast.error(t('Login failed'));
- throw err;
- }
+ const loginWithOAuth = useEvent(
+ async (provider: BuiltInProviderType | 'custom') => {
+ let res: SignInResponse | undefined;
+ try {
+ res = await signIn(provider, {
+ redirect: false,
+ });
+ console.log('res', res);
+ } catch (err) {
+ toast.error(t('Login failed'));
+ throw err;
+ }
- if (res?.error) {
- toast.error(t('Login failed'));
- throw new Error('Login failed');
- }
+ if (res?.error) {
+ toast.error(t('Login failed'));
+ throw new Error('Login failed');
+ }
- const userInfo = await trpcUtils.user.info.fetch();
- if (!userInfo) {
- toast.error(t('Can not get current user info'));
- throw new Error('Login failed, ');
- }
+ const userInfo = await trpcUtils.user.info.fetch();
+ if (!userInfo) {
+ toast.error(t('Can not get current user info'));
+ throw new Error('Login failed, ');
+ }
- return userInfo;
- });
+ return userInfo;
+ }
+ );
const logout = useEvent(async () => {
await signOut({
diff --git a/src/client/routes/login.tsx b/src/client/routes/login.tsx
index 327d0f7..a616812 100644
--- a/src/client/routes/login.tsx
+++ b/src/client/routes/login.tsx
@@ -8,7 +8,7 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { useAuth } from '@/api/authjs/useAuth';
import { useEventWithLoading } from '@/hooks/useEvent';
-import { LuGithub } from 'react-icons/lu';
+import { LuGithub, LuLayers } from 'react-icons/lu';
export const Route = createFileRoute('/login')({
validateSearch: z.object({
@@ -102,14 +102,26 @@ function LoginComponent() {
<>