@replyke/core
Version:
Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.
40 lines (39 loc) • 1.24 kB
TypeScript
export interface SignUpWithEmailAndPasswordProps {
email: string;
password: string;
name?: string;
username?: string;
avatar?: string;
bio?: string;
location?: {
latitude: number;
longitude: number;
};
birthdate?: Date;
metadata?: Record<string, any>;
secureMetadata?: Record<string, any>;
avatarFile?: File | Blob;
avatarOptions?: any;
bannerFile?: File | Blob;
bannerOptions?: any;
}
export interface SignInWithEmailAndPasswordProps {
email: string;
password: string;
}
export interface ChangePasswordProps {
password: string;
newPassword: string;
}
export interface UseAuthValues {
initialized: boolean;
accessToken: string | null;
refreshToken: string | null;
setRefreshToken: React.Dispatch<React.SetStateAction<string | null>>;
signUpWithEmailAndPassword: (props: SignUpWithEmailAndPasswordProps) => Promise<void>;
signInWithEmailAndPassword: (props: SignInWithEmailAndPasswordProps) => Promise<void>;
signOut: () => Promise<void>;
changePassword: (props: ChangePasswordProps) => Promise<void>;
requestNewAccessToken: () => Promise<string | undefined>;
}
export default function useAuth(): UseAuthValues;