From 01e86fb4a54b801a9b8124455611c312e5de4af0 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Mon, 14 Aug 2023 15:04:45 +0700 Subject: google sign in --- src/lib/auth/components/LoginMobile.jsx | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/lib/auth/components/LoginMobile.jsx') diff --git a/src/lib/auth/components/LoginMobile.jsx b/src/lib/auth/components/LoginMobile.jsx index b365330b..c5177625 100644 --- a/src/lib/auth/components/LoginMobile.jsx +++ b/src/lib/auth/components/LoginMobile.jsx @@ -5,10 +5,22 @@ import Alert from '@/core/components/elements/Alert/Alert' import MobileView from '@/core/components/views/MobileView' import useLogin from '../hooks/useLogin' +import { useSession, signIn, SignOut } from 'next-auth/react' +import { useRouter } from 'next/router' +import { useState } from 'react' + const LoginMobile = () => { const { handleSubmit, handleChangeInput, isLoading, isValid, alert, emailRef, passwordRef } = useLogin() + const router = useRouter() + const [query, setQuery] = useState(router?.query?.next || '/') + const { data: session } = useSession() + + if (session) { + router.push(query) + } + return (
@@ -56,6 +68,26 @@ const LoginMobile = () => { {!isLoading ? 'Masuk' : 'Loading...'} +
+
+

ATAU

+
+
+ +
Belum punya akun Indoteknik?{' '} -- cgit v1.2.3