mirror of
https://github.com/jellyfin/jellyfin-vue.git
synced 2024-12-11 15:55:58 +00:00
15 lines
391 B
TypeScript
15 lines
391 B
TypeScript
import { Context } from '@nuxt/types';
|
|
|
|
/**
|
|
* Middleware providing a redirect to the home page in case the
|
|
* User is not Admin and tries to access the admin page.
|
|
*
|
|
* @param {Context} context - Nuxt application context
|
|
* @returns {void}
|
|
*/
|
|
export default function (context: Context): void {
|
|
if (!context.$auth.user?.Policy?.IsAdministrator) {
|
|
return context.redirect('/');
|
|
}
|
|
}
|