aboutsummaryrefslogtreecommitdiffstats
path: root/src/views/Authorization
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/Authorization')
-rw-r--r--src/views/Authorization/LoginView.jsx11
1 files changed, 8 insertions, 3 deletions
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 => {