UNPKG

strapi-plugin-firebase-authentication

Version:

Allows easy integration between clients utilizing Firebase for authentication and Strapi

51 lines (50 loc) 2.05 kB
export interface TokenValidationResult { valid: boolean; firebaseUserDataDocumentId: string; firebaseUID: string; error?: string; } export interface VerificationTokenValidationResult extends TokenValidationResult { email?: string; code?: string; } declare const _default: ({ strapi }: { strapi: any; }) => { /** * Generate a password reset token for a user * @param firebaseUserDataDocumentId - The documentId of the firebase-user-data record * @returns The JWT token to include in the reset URL */ generateResetToken(firebaseUserDataDocumentId: string): Promise<string>; /** * Validate a password reset token * @param token - The JWT token from the reset URL * @returns Validation result with user info if valid */ validateResetToken(token: string): Promise<TokenValidationResult>; /** * Invalidate a reset token after use * @param firebaseUserDataDocumentId - The documentId of the firebase-user-data record */ invalidateResetToken(firebaseUserDataDocumentId: string): Promise<void>; /** * Generate an email verification token for a user * @param firebaseUserDataDocumentId - The documentId of the firebase-user-data record * @param email - The email address at time of request (for change detection) * @returns The JWT token to include in the verification URL */ generateVerificationToken(firebaseUserDataDocumentId: string, email: string): Promise<string>; /** * Validate an email verification token * @param token - The JWT token from the verification URL * @returns Validation result with user info and email if valid */ validateVerificationToken(token: string): Promise<VerificationTokenValidationResult>; /** * Invalidate a verification token after use * @param firebaseUserDataDocumentId - The documentId of the firebase-user-data record */ invalidateVerificationToken(firebaseUserDataDocumentId: string): Promise<void>; }; export default _default;