@@ -14,10 +14,10 @@ export function syncToken({commit, dispatch}) {
1414/**
1515 * Sync router for auth
1616 */
17- export function syncRouter ( { state, dispatch} , router ) {
17+ export function syncRouter ( { state, dispatch} , myRouter ) {
1818 dispatch ( 'syncToken' ) ;
1919
20- router . beforeEach ( ( to , from , next ) => {
20+ myRouter . beforeEach ( ( to , from , next ) => {
2121 if ( to . matched . some ( record => record . meta . requiresAuth ) ) {
2222 // this route requires auth, check if logged in
2323 // if not, redirect to login page (except when it's profile route and
@@ -103,7 +103,7 @@ export function loadAccount({commit}, userId) {
103103 * @param {String } newPassword new password
104104 * @return {Promise } promise of the password reset
105105 */
106- export function resetPassword ( { commit , state } , { oldPassword, newPassword} ) {
106+ export function resetPassword ( ctx , { oldPassword, newPassword} ) {
107107 return loopback
108108 . post (
109109 '/Accounts/change-password' ,
@@ -117,7 +117,7 @@ export function resetPassword({commit, state}, {oldPassword, newPassword}) {
117117 * @param {String } email user email
118118 * @return {Promise } promise of the sent email
119119 */
120- export function rememberPassword ( { commit } , email ) {
120+ export function rememberPassword ( ctx , email ) {
121121 return loopback
122122 . post ( '/Accounts/reset' , { email} ) ;
123123}
0 commit comments