X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Frouter.js;h=ae298a7e1172249a879e5b5f6fd75bf088587392;hp=0f0384976481dfcbe590c547e1ac0b077e304622;hb=98f485791e915563996de4f37430b285ffc773ae;hpb=d737116438d84785f2cee6661b35c18fef039a64 diff --git a/client/src/router.js b/client/src/router.js index 0f038497..ae298a7e 100644 --- a/client/src/router.js +++ b/client/src/router.js @@ -37,11 +37,15 @@ export default new Router({ "GET", {token: to.params["token"]}, (res) => { - store.state.user.id = res.id; - store.state.user.name = res.name; - store.state.user.email = res.email; - store.state.user.notify = res.notify; - // NOTE: mysid isn't cleared (required for potential game continuation) + if (!res.errmsg) //if not already logged in + { + store.state.user.id = res.id; + store.state.user.name = res.name; + store.state.user.email = res.email; + store.state.user.notify = res.notify; + localStorage["myname"] = res.name; + localStorage["myid"] = res.id; + } next(); } );