From b6f6bf23f90ff0dfadf9bf0af8866c2cfc17aa9c Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Fri, 18 Aug 2023 11:02:39 +0700
Subject: handling redirect login

---
 src/lib/auth/components/RegisterMobile.jsx | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

(limited to 'src/lib/auth/components/RegisterMobile.jsx')

diff --git a/src/lib/auth/components/RegisterMobile.jsx b/src/lib/auth/components/RegisterMobile.jsx
index c21c9325..2e918a14 100644
--- a/src/lib/auth/components/RegisterMobile.jsx
+++ b/src/lib/auth/components/RegisterMobile.jsx
@@ -11,6 +11,7 @@ import { signIn, useSession } from 'next-auth/react'
 import { useRouter } from 'next/router'
 import { setCookie } from 'cookies-next'
 import { useEffect } from 'react'
+import LogoSpinner from '@/core/components/elements/Spinner/LogoSpinner'
 
 const RegisterMobile = () => {
   const {
@@ -32,7 +33,7 @@ const RegisterMobile = () => {
   const router = useRouter()
   
   const handleGoogle = async () => {
-    await signIn('google', { callbackUrl: '/register' })
+    await signIn('google', { callbackUrl: '/register?source=google' })
   }
 
   useEffect(() => {
@@ -42,6 +43,16 @@ const RegisterMobile = () => {
     }
   },[session])
 
+  if (router.query.source) {
+    return (
+      <BottomPopup active={true} close=''>
+        <div className='leading-7 text-gray_r-12/80 flex justify-center'>Mohon Tunggu</div>
+        <div className='container flex justify-center my-4'>
+          <LogoSpinner width={48} height={48} />
+        </div>
+      </BottomPopup>
+    )
+  }
   return (
     <MobileView>
       <div className='p-6 pt-10 flex flex-col items-center min-h-screen'>
-- 
cgit v1.2.3

