File tree Expand file tree Collapse file tree 4 files changed +6
-5
lines changed
templates/vue/application/src Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 11let authenticated = true ;
22export default {
3- athenticated ( ) {
3+ authenticated ( ) {
44 return authenticated ;
55 } ,
66 logIn ( ) {
Original file line number Diff line number Diff line change @@ -89,7 +89,8 @@ export default {
8989 onLogoutClick () {
9090 auth .logOut ();
9191 this .$router .push ({
92- path: " /login-form"
92+ path: " /login-form" ,
93+ query: { redirect: this .$route .path }
9394 });
9495 }
9596 },
Original file line number Diff line number Diff line change @@ -80,12 +80,12 @@ const router = new Router({
8080
8181router . beforeEach ( ( to , from , next ) => {
8282
83- if ( to . name === "login-form" && auth . athenticated ( ) ) {
83+ if ( to . name === "login-form" && auth . authenticated ( ) ) {
8484 next ( { name : "home" } ) ;
8585 }
8686
8787 if ( to . matched . some ( record => record . meta . requiresAuth ) ) {
88- if ( ! auth . athenticated ( ) ) {
88+ if ( ! auth . authenticated ( ) ) {
8989 next ( {
9090 name : "login-form" ,
9191 query : { redirect : to . fullPath }
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ export default {
7474 }
7575
7676 auth .logIn ();
77- this .$router .push (" /home" );
77+ this .$router .push (this . $route . query . redirect || " /home" );
7878
7979 e .validationGroup .reset ();
8080 }
You can’t perform that action at this time.
0 commit comments