From 9a07689dfeb736341b4f1b378e0ec758ea9cd0ff Mon Sep 17 00:00:00 2001
From: Mo Tarbin <mhed.t91@gmail.com>
Date: Sat, 6 Jul 2024 02:33:06 -0400
Subject: feat: Add NFC tag writing functionality to ChoreCard component, Add
 Email to sign up

---
 src/views/Authorization/LoginView.jsx | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

(limited to 'src/views/Authorization/LoginView.jsx')

diff --git a/src/views/Authorization/LoginView.jsx b/src/views/Authorization/LoginView.jsx
index 2ffcef4..721a5b3 100644
--- a/src/views/Authorization/LoginView.jsx
+++ b/src/views/Authorization/LoginView.jsx
@@ -62,7 +62,6 @@ const LoginView = () => {
   }
 
   const loggedWithProvider = function (provider, data) {
-    console.log(provider, data)
     return fetch(API_URL + `/auth/${provider}/callback`, {
       method: 'POST',
       headers: {
@@ -80,8 +79,14 @@ const LoginView = () => {
         return response.json().then(data => {
           localStorage.setItem('ca_token', data.token)
           localStorage.setItem('ca_expiration', data.expire)
-          // setIsLoggedIn(true);
-          getUserProfileAndNavigateToHome()
+
+          const redirectUrl = Cookies.get('ca_redirect')
+          if (redirectUrl) {
+            Cookies.remove('ca_redirect')
+            Navigate(redirectUrl)
+          } else {
+            getUserProfileAndNavigateToHome()
+          }
         })
       }
       return response.json().then(error => {
-- 
cgit 

