mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-12-21 06:51:19 +08:00
25 lines
794 B
TypeScript
25 lines
794 B
TypeScript
import { Component, State, Vue } from 'nuxt-property-decorator';
|
|
import { HangarUser } from 'hangar-internal';
|
|
import { AuthState } from '~/store/auth';
|
|
import { RootState } from '~/store';
|
|
|
|
@Component
|
|
export class HangarComponent extends Vue {
|
|
@State((state: AuthState) => state.user, { namespace: 'auth' })
|
|
currentUser!: HangarUser | null;
|
|
|
|
@State((state: AuthState) => state.token || '', { namespace: 'auth' })
|
|
jwt!: string;
|
|
|
|
@State((state: RootState) => state.validations)
|
|
validations!: RootState['validations'];
|
|
|
|
@State((state: AuthState) => state.authenticated, { namespace: 'auth' })
|
|
isLoggedIn!: boolean;
|
|
}
|
|
|
|
export class Authed extends HangarComponent {
|
|
@State((state: AuthState) => state.user, { namespace: 'auth' })
|
|
currentUser!: HangarUser;
|
|
}
|