Created
November 11, 2025 17:04
-
-
Save Klerith/da9b9218c1b0e843e88807e632e9da60 to your computer and use it in GitHub Desktop.
Expandir el tipo User de la sesión
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // auth.d.ts | |
| declare module '#auth-utils' { | |
| // Define the structure of your user object | |
| interface User { | |
| id: string; | |
| email: string; | |
| name?: string; // Optional field | |
| roles: string[]; // Example of a specific role type | |
| } | |
| // Define any additional data you want to store in the session | |
| interface UserSession { | |
| loggedInAt: Date; | |
| // Add other session-specific data here if needed | |
| } | |
| // Define secure session data if you have any server-side only data | |
| interface SecureSessionData { | |
| // Add your own fields for server-side only data | |
| } | |
| } | |
| export {}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment