* chore: Remove all avatar/logo references * Updated user profile to only use avatarUrl * fix: minor style issue * chore: Remove redundant includeTeamLogo * fix: Use right avatar default in event type list * fix: placeholder avatar team profile, target * chore: Add logoUrl/avatarUrl to JWT * fix: Bunch of org avatar issues, fix members list * Fix logoUrl on org pages * More type fixes * Hopefully final type fixes * Another round of type fixes * fix: UserForm ts * fix: Handle as return types, not input types * fix: Remove profile and add avatarUrl * fix: notFound as const * fix: Seeder avatarUrl params * revert: Migration changes for easier recovery * fix: Add explicit type to builder as avatar is now set * Add logoUrl to unpublished entity * Avatar test out of scope here * fix: Use the new avatarUrl after save * chore: Removed getOrgAvatarUrl/getTeamAvatarUrl * fix: Update sidebar image immediately after change * Unable to safe unnamed user, so default * fix: Unpublished page, add organization test * Add more tests
69 lines
1.7 KiB
TypeScript
69 lines
1.7 KiB
TypeScript
import type { User as PrismaUser, UserPermissionRole } from "@prisma/client";
|
|
import type { DefaultUser } from "next-auth";
|
|
|
|
import type { UserProfile } from "./UserProfile";
|
|
|
|
declare module "next-auth" {
|
|
/**
|
|
* Returned by `useSession`, `getSession` and received as a prop on the `Provider` React Context
|
|
*/
|
|
interface Session {
|
|
hasValidLicense: boolean;
|
|
profileId?: number | null;
|
|
upId: string;
|
|
user: User;
|
|
}
|
|
|
|
interface User extends Omit<DefaultUser, "id"> {
|
|
id: PrismaUser["id"];
|
|
emailVerified?: PrismaUser["emailVerified"];
|
|
email_verified?: boolean;
|
|
impersonatedBy?: {
|
|
id: number;
|
|
role: PrismaUser["role"];
|
|
};
|
|
belongsToActiveTeam?: boolean;
|
|
org?: {
|
|
id: number;
|
|
name?: string;
|
|
slug: string;
|
|
logoUrl?: string | null;
|
|
fullDomain: string;
|
|
domainSuffix: string;
|
|
};
|
|
username?: PrismaUser["username"];
|
|
avatarUrl?: PrismaUser["avatarUrl"];
|
|
role?: PrismaUser["role"] | "INACTIVE_ADMIN";
|
|
locale?: string | null;
|
|
profile: UserProfile;
|
|
}
|
|
}
|
|
|
|
declare module "next-auth/jwt" {
|
|
interface JWT {
|
|
id?: string | number;
|
|
name?: string | null;
|
|
username?: string | null;
|
|
avatarUrl?: string | null;
|
|
email?: string | null;
|
|
upId?: string;
|
|
profileId?: number | null;
|
|
role?: UserPermissionRole | "INACTIVE_ADMIN" | null;
|
|
impersonatedBy?: {
|
|
id: number;
|
|
role: PrismaUser["role"];
|
|
};
|
|
belongsToActiveTeam?: boolean;
|
|
org?: {
|
|
id: number;
|
|
name?: string;
|
|
slug: string;
|
|
logoUrl?: string | null;
|
|
fullDomain: string;
|
|
domainSuffix: string;
|
|
};
|
|
organizationId?: number | null;
|
|
locale?: string;
|
|
}
|
|
}
|