Skip to content

Commit

Permalink
feat: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
shahargl committed Nov 24, 2024
1 parent 2430075 commit 1a7b7f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions keep-ui/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { customFetch } from "next-auth";
import Credentials from "next-auth/providers/credentials";
import Keycloak from "next-auth/providers/keycloak";
import Auth0 from "next-auth/providers/auth0";
import MicrosoftEntraID from "@auth/core/providers/microsoft-entra-id";
import MicrosoftEntraID from "next-auth/providers/microsoft-entra-id";
import { AuthError } from "next-auth";
import { AuthenticationError, AuthErrorCodes } from "@/errors";
import type { JWT } from "@auth/core/jwt";
import type { JWT } from "next-auth/jwt";
// https://github.com/nextauthjs/next-auth/issues/11028

export class BackendRefusedError extends AuthError {
Expand Down
11 changes: 6 additions & 5 deletions keep-ui/types/auth.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { DefaultSession } from "@auth/core/types";
import type { DefaultSession } from "next-auth";
import type { JWT } from "next-auth/jwt";

declare module "@auth/core/types" {
declare module "next-auth" {
interface Session {
accessToken: string;
tenantId?: string;
Expand All @@ -13,7 +14,7 @@ declare module "@auth/core/types" {
accessToken: string;
tenantId?: string;
role?: string;
};
} & DefaultSession["user"];
}

interface User {
Expand All @@ -26,9 +27,9 @@ declare module "@auth/core/types" {
}
}

declare module "@auth/core/jwt" {
declare module "next-auth/jwt" {
interface JWT {
accessToken: string; // Changed to required
accessToken: string;
tenantId?: string;
role?: string;
}
Expand Down

0 comments on commit 1a7b7f8

Please sign in to comment.