@@ -46,11 +46,59 @@ 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.
5249 content : ( ) =>
5350 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+ }
54102 }
55103 } ,
56104 {
@@ -70,12 +118,12 @@ const router = new Router({
70118
71119router . beforeEach ( ( to , from , next ) => {
72120
73- if ( to . name === "login-form" && auth . authenticated ( ) ) {
121+ if ( to . name === "login-form" && auth . loggedIn ( ) ) {
74122 next ( { name : "home" } ) ;
75123 }
76124
77125 if ( to . matched . some ( record => record . meta . requiresAuth ) ) {
78- if ( ! auth . authenticated ( ) ) {
126+ if ( ! auth . loggedIn ( ) ) {
79127 next ( {
80128 name : "login-form" ,
81129 query : { redirect : to . fullPath }
0 commit comments