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/RegisterDesktop.jsx | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

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

diff --git a/src/lib/auth/components/RegisterDesktop.jsx b/src/lib/auth/components/RegisterDesktop.jsx
index 86a5027d..a2bc98c2 100644
--- a/src/lib/auth/components/RegisterDesktop.jsx
+++ b/src/lib/auth/components/RegisterDesktop.jsx
@@ -10,6 +10,7 @@ import { useEffect } from 'react'
 import { setCookie } from 'cookies-next'
 import { signIn, useSession } from 'next-auth/react'
 import { useRouter } from 'next/router'
+import LogoSpinner from '@/core/components/elements/Spinner/LogoSpinner'
 
 const RegisterDesktop = () => {
   const {
@@ -31,7 +32,7 @@ const RegisterDesktop = () => {
   const router = useRouter()
   
   const handleGoogle = async () => {
-    await signIn('google', { callbackUrl: '/register' })
+    await signIn('google', { callbackUrl: '/register?source=google' })
   }
 
   useEffect(() => {
@@ -41,6 +42,17 @@ const RegisterDesktop = () => {
     }
   },[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 (
     <DesktopView>
       <div className='container mx-auto'>
-- 
cgit v1.2.3

