@replyke/core
Version:
Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.
42 lines (41 loc) • 1.32 kB
TypeScript
import { AuthUser } from "../../interfaces/models/User";
export interface UseAuthDataProps {
signedToken?: string | null | undefined;
}
export interface UseAuthDataValues {
loadingInitial: boolean;
user: AuthUser | null;
setUser: (newUser: AuthUser) => void;
accessToken: string | null;
refreshToken: string | null;
setRefreshToken: React.Dispatch<React.SetStateAction<string | null>>;
signUpWithEmailAndPassword: (props: {
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>;
}) => Promise<void>;
signInWithEmailAndPassword: (props: {
email: string;
password: string;
}) => Promise<void>;
signOut: () => Promise<void>;
changePassword: (props: {
publicKeyBase64: string | null;
email: string;
password: string;
newPassword: string;
}) => Promise<void>;
requestNewAccessToken: () => Promise<void>;
}
declare function useAuthData({ signedToken }: UseAuthDataProps): UseAuthDataValues;
export default useAuthData;