Skip to content

Instantly share code, notes, and snippets.

@Klerith
Created November 11, 2025 17:04
Show Gist options
  • Select an option

  • Save Klerith/da9b9218c1b0e843e88807e632e9da60 to your computer and use it in GitHub Desktop.

Select an option

Save Klerith/da9b9218c1b0e843e88807e632e9da60 to your computer and use it in GitHub Desktop.
Expandir el tipo User de la sesión
// 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