Client - redirect after login if redirection exists

This commit is contained in:
Sam 2021-11-03 09:41:27 +01:00
parent 987503ca96
commit fece99921b
19 changed files with 34 additions and 26 deletions

View File

@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><!--[if IE]><link rel="icon" href="/favicon.ico"><![endif]--><link rel="stylesheet" href="/static/css/fork-awesome.min.css"><link rel="stylesheet" href="/static/css/leaflet.css"><title>FitTrackee</title><link href="/static/css/admin.27bf6ef5.css" rel="prefetch"><link href="/static/css/main.b2ab76b7.css" rel="prefetch"><link href="/static/css/main~workouts.dec22e70.css" rel="prefetch"><link href="/static/css/profile.8c004342.css" rel="prefetch"><link href="/static/css/reset.3a3a50ad.css" rel="prefetch"><link href="/static/css/workouts.45fb3086.css" rel="prefetch"><link href="/static/js/admin.ae6123c4.js" rel="prefetch"><link href="/static/js/chunk-2d0c9189.c81458cc.js" rel="prefetch"><link href="/static/js/chunk-2d0cf391.020c75ea.js" rel="prefetch"><link href="/static/js/chunk-2d0da8f3.c8c3e7e8.js" rel="prefetch"><link href="/static/js/chunk-2d2248b6.d84473c1.js" rel="prefetch"><link href="/static/js/chunk-2d22523a.4b710d99.js" rel="prefetch"><link href="/static/js/main.bf1c6a90.js" rel="prefetch"><link href="/static/js/main~workouts.896585f2.js" rel="prefetch"><link href="/static/js/profile.998bc0bd.js" rel="prefetch"><link href="/static/js/reset.00470419.js" rel="prefetch"><link href="/static/js/workouts.13789396.js" rel="prefetch"><link href="/static/css/app.4717d662.css" rel="preload" as="style"><link href="/static/js/app.e3db0803.js" rel="preload" as="script"><link href="/static/js/chunk-vendors.61765c73.js" rel="preload" as="script"><link href="/static/css/app.4717d662.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="/img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/img/icons/favicon-16x16.png"><link rel="manifest" href="/manifest.json"><meta name="theme-color" content="#4DBA87"><meta name="apple-mobile-web-app-capable" content="no"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="fittrackee_client"><link rel="apple-touch-icon" href="/img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="/img/icons/safari-pinned-tab.svg" color="#4DBA87"><meta name="msapplication-TileImage" content="/img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#000000"></head><body><noscript><strong>We're sorry but FitTrackee doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/static/js/chunk-vendors.61765c73.js"></script><script src="/static/js/app.e3db0803.js"></script></body></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><!--[if IE]><link rel="icon" href="/favicon.ico"><![endif]--><link rel="stylesheet" href="/static/css/fork-awesome.min.css"><link rel="stylesheet" href="/static/css/leaflet.css"><title>FitTrackee</title><link href="/static/css/admin.27bf6ef5.css" rel="prefetch"><link href="/static/css/main.18c88976.css" rel="prefetch"><link href="/static/css/main~workouts.dec22e70.css" rel="prefetch"><link href="/static/css/profile.8c004342.css" rel="prefetch"><link href="/static/css/reset.0a21856c.css" rel="prefetch"><link href="/static/css/workouts.45fb3086.css" rel="prefetch"><link href="/static/js/admin.ae6123c4.js" rel="prefetch"><link href="/static/js/chunk-2d0c9189.c81458cc.js" rel="prefetch"><link href="/static/js/chunk-2d0cf391.020c75ea.js" rel="prefetch"><link href="/static/js/chunk-2d0da8f3.c8c3e7e8.js" rel="prefetch"><link href="/static/js/chunk-2d2248b6.d84473c1.js" rel="prefetch"><link href="/static/js/chunk-2d22523a.4b710d99.js" rel="prefetch"><link href="/static/js/main.308f7e1a.js" rel="prefetch"><link href="/static/js/main~workouts.896585f2.js" rel="prefetch"><link href="/static/js/profile.998bc0bd.js" rel="prefetch"><link href="/static/js/reset.624f741d.js" rel="prefetch"><link href="/static/js/workouts.13789396.js" rel="prefetch"><link href="/static/css/app.4717d662.css" rel="preload" as="style"><link href="/static/js/app.dad9d7e0.js" rel="preload" as="script"><link href="/static/js/chunk-vendors.61765c73.js" rel="preload" as="script"><link href="/static/css/app.4717d662.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="/img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/img/icons/favicon-16x16.png"><link rel="manifest" href="/manifest.json"><meta name="theme-color" content="#4DBA87"><meta name="apple-mobile-web-app-capable" content="no"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="fittrackee_client"><link rel="apple-touch-icon" href="/img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="/img/icons/safari-pinned-tab.svg" color="#4DBA87"><meta name="msapplication-TileImage" content="/img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#000000"></head><body><noscript><strong>We're sorry but FitTrackee doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/static/js/chunk-vendors.61765c73.js"></script><script src="/static/js/app.dad9d7e0.js"></script></body></html>

View File

@ -64,7 +64,7 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "/img/workouts/mountains.svg"
},
{
"revision": "f8116d9a2ccda80b8ea0eba64d64f184",
"revision": "9623aa1a1c19a881086977a3edfc1145",
"url": "/index.html"
},
{
@ -80,7 +80,7 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "/static/css/admin.27bf6ef5.css"
},
{
"revision": "e0dc1db4371c2765d2d2",
"revision": "6b46b4d95a705ed57b97",
"url": "/static/css/app.4717d662.css"
},
{
@ -92,8 +92,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "/static/css/leaflet.css"
},
{
"revision": "42ff0e9b410d8f35397e",
"url": "/static/css/main.b2ab76b7.css"
"revision": "e3c1b38f9a3f799718d9",
"url": "/static/css/main.18c88976.css"
},
{
"revision": "70f944368dc20379d927",
@ -104,8 +104,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "/static/css/profile.8c004342.css"
},
{
"revision": "5977b5ce6ee55c119f41",
"url": "/static/css/reset.3a3a50ad.css"
"revision": "79922e937a9828c3da47",
"url": "/static/css/reset.0a21856c.css"
},
{
"revision": "8673354a75e744432857",
@ -196,8 +196,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "/static/js/admin.ae6123c4.js"
},
{
"revision": "e0dc1db4371c2765d2d2",
"url": "/static/js/app.e3db0803.js"
"revision": "6b46b4d95a705ed57b97",
"url": "/static/js/app.dad9d7e0.js"
},
{
"revision": "bd7d183c9f68e5f4027d",
@ -224,8 +224,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "/static/js/chunk-vendors.61765c73.js"
},
{
"revision": "42ff0e9b410d8f35397e",
"url": "/static/js/main.bf1c6a90.js"
"revision": "e3c1b38f9a3f799718d9",
"url": "/static/js/main.308f7e1a.js"
},
{
"revision": "70f944368dc20379d927",
@ -236,8 +236,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "/static/js/profile.998bc0bd.js"
},
{
"revision": "5977b5ce6ee55c119f41",
"url": "/static/js/reset.00470419.js"
"revision": "79922e937a9828c3da47",
"url": "/static/js/reset.624f741d.js"
},
{
"revision": "8673354a75e744432857",

View File

@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
importScripts(
"/precache-manifest.55638804662f941d631c5fc00bf18b29.js"
"/precache-manifest.044e624348389b8946ac9a1756fae04a.js"
);
workbox.core.setCacheNameDetails({prefix: "fittrackee_client"});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -156,6 +156,7 @@
store.dispatch(USER_STORE.ACTIONS.LOGIN_OR_REGISTER, {
actionType,
formData,
redirectUrl: route.query.from,
})
}
}

View File

@ -97,7 +97,11 @@ export const actions: ActionTree<IUserState, IRootState> & IUserActions = {
context.commit(USER_STORE.MUTATIONS.UPDATE_AUTH_TOKEN, token)
context
.dispatch(USER_STORE.ACTIONS.GET_USER_PROFILE)
.then(() => router.push('/'))
.then(() =>
router.push(
typeof data.redirectUrl === 'string' ? data.redirectUrl : '/'
)
)
} else {
handleError(context, null)
}

View File

@ -1,3 +1,5 @@
import { LocationQueryValue } from 'vue-router'
import { IRecord } from '@/types/workouts'
export interface IUserProfile {
@ -71,4 +73,5 @@ export interface ILoginRegisterFormData {
export interface ILoginOrRegisterData {
actionType: string
formData: ILoginRegisterFormData
redirectUrl?: string | null | LocationQueryValue[]
}