// Do not use the barrel (dependency loop)
+import { UserRole } from '../../../../../shared/models/user.model'
import { User } from '../../shared/users/user.model';
export class AuthUser extends User {
id: parseInt(localStorage.getItem(this.KEYS.ID)),
username: localStorage.getItem(this.KEYS.USERNAME),
email: localStorage.getItem(this.KEYS.EMAIL),
- role: localStorage.getItem(this.KEYS.ROLE),
+ role: localStorage.getItem(this.KEYS.ROLE) as UserRole,
displayNSFW: localStorage.getItem(this.KEYS.DISPLAY_NSFW) === 'true'
},
Tokens.load()
constructor(userHash: {
id: number,
username: string,
- role: string,
+ role: UserRole,
email: string,
displayNSFW: boolean
}, hashTokens: any) {
-import { User as UserServerModel } from '../../../../../shared';
+import { User as UserServerModel, UserRole } from '../../../../../shared';
export class User implements UserServerModel {
id: number;
username: string;
email: string;
- role: string;
+ role: UserRole;
displayNSFW: boolean;
createdAt: Date;
id: number,
username: string,
email: string,
- role: string,
+ role: UserRole,
displayNSFW?: boolean,
createdAt?: Date,
}) {