@@ -46,59 +46,11 @@ const router = new Router({
4646 meta : { requiresAuth : false } ,
4747 components : {
4848 layout : simpleLayout ,
49+ // route level code-splitting
50+ // this generates a separate chunk (login.[hash].js) for this route
51+ // which is lazy-loaded when the route is visited.
4952 content : ( ) =>
5053 import ( /* webpackChunkName: "login" */ "./views/login-form" )
51- } ,
52- props : {
53- layout : {
54- title : "Sign In"
55- }
56- }
57- } ,
58- {
59- path : "/reset-password" ,
60- name : "reset-password" ,
61- meta : { requiresAuth : false } ,
62- components : {
63- layout : simpleLayout ,
64- content : ( ) =>
65- import ( /* webpackChunkName: "login" */ "./views/reset-password-form" )
66- } ,
67- props : {
68- layout : {
69- title : "Reset Password" ,
70- description : "Please enter the email address that you used to register, and we will send you a link to reset your password via Email."
71- }
72- }
73- } ,
74- {
75- path : "/create-account" ,
76- name : "create-account" ,
77- meta : { requiresAuth : false } ,
78- components : {
79- layout : simpleLayout ,
80- content : ( ) =>
81- import ( /* webpackChunkName: "login" */ "./views/create-account-form" )
82- } ,
83- props : {
84- layout : {
85- title : "Sign Up"
86- }
87- }
88- } ,
89- {
90- path : "/change-password/:recoveryCode" ,
91- name : "change-password" ,
92- meta : { requiresAuth : false } ,
93- components : {
94- layout : simpleLayout ,
95- content : ( ) =>
96- import ( /* webpackChunkName: "login" */ "./views/change-password-form" )
97- } ,
98- props : {
99- layout : {
100- title : "Change Password"
101- }
10254 }
10355 } ,
10456 {
@@ -118,12 +70,12 @@ const router = new Router({
11870
11971router . beforeEach ( ( to , from , next ) => {
12072
121- if ( to . name === "login-form" && auth . loggedIn ( ) ) {
73+ if ( to . name === "login-form" && auth . authenticated ( ) ) {
12274 next ( { name : "home" } ) ;
12375 }
12476
12577 if ( to . matched . some ( record => record . meta . requiresAuth ) ) {
126- if ( ! auth . loggedIn ( ) ) {
78+ if ( ! auth . authenticated ( ) ) {
12779 next ( {
12880 name : "login-form" ,
12981 query : { redirect : to . fullPath }
0 commit comments