next-auth.d.ts 728 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { DefaultSession } from 'next-auth';
  2. declare module 'next-auth' {
  3. /**
  4. * Returned by `useSession`, `getSession` and received as a prop on the `SessionProvider` React Context
  5. */
  6. interface Session {
  7. user: {
  8. id: string;
  9. firstname?: string;
  10. lastname?: string;
  11. token?: string;
  12. accessToken?: string;
  13. apiToken?: string;
  14. role?: string;
  15. } & DefaultSession['user'];
  16. }
  17. interface User {
  18. id: string;
  19. accessToken?: string;
  20. apiToken?: string;
  21. role?: string;
  22. tokenType?: string;
  23. expiresIn?: number;
  24. }
  25. }
  26. declare module 'next-auth/jwt' {
  27. interface JWT {
  28. accessToken?: string;
  29. apiToken?: string;
  30. role?: string;
  31. id?: string;
  32. }
  33. }