UX: Forward /login to /browse if users is authenticated

This commit is contained in:
Michael Mayer 2021-01-28 13:12:23 +01:00
parent bd17b4f3b7
commit 6e8bf97f4f

View file

@ -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",