UX: Forward /login to /browse if users is authenticated
This commit is contained in:
parent
bd17b4f3b7
commit
6e8bf97f4f
1 changed files with 8 additions and 0 deletions
|
@ -45,6 +45,7 @@ import Feedback from "pages/about/feedback.vue";
|
|||
import License from "pages/about/license.vue";
|
||||
import Help from "pages/help.vue";
|
||||
import { $gettext } from "common/vm";
|
||||
import { session } from "./session";
|
||||
|
||||
const c = window.__CONFIG__;
|
||||
const appName = c.name;
|
||||
|
@ -85,6 +86,13 @@ export default [
|
|||
path: "/login",
|
||||
component: Login,
|
||||
meta: { title: siteTitle, auth: false },
|
||||
beforeEnter: (to, from, next) => {
|
||||
if (session.isUser()) {
|
||||
next({ name: "home" });
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "browse",
|
||||
|
|
Loading…
Reference in a new issue