mirror of https://github.com/wg-easy/wg-easy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
393 B
14 lines
393 B
export default defineEventHandler(async (event) => {
|
|
const url = getRequestURL(event);
|
|
const session = await useWGSession(event);
|
|
if (url.pathname === '/login') {
|
|
if (session.data.authenticated) {
|
|
return sendRedirect(event, '/', 302);
|
|
}
|
|
}
|
|
if (url.pathname === '/') {
|
|
if (!session.data.authenticated) {
|
|
return sendRedirect(event, '/login', 302);
|
|
}
|
|
}
|
|
});
|
|
|