react-redux-django-auth 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -34,9 +34,82 @@ interface SignupHookReturn {
34
34
  }
35
35
  declare const useSignup: (initialFields: any, apiUrl: string) => SignupHookReturn;
36
36
 
37
+ interface AuthHookReturn {
38
+ error: any;
39
+ isAuthenticated: boolean | null;
40
+ currentUser: any;
41
+ clearErrors: () => void;
42
+ refreshUser: () => void;
43
+ refreshAuth: () => Promise<void>;
44
+ }
45
+ declare const useAuthicatedUser: (apiURL: string, location: any) => AuthHookReturn;
46
+
47
+ interface ResetPasswordHookReturn {
48
+ email: string;
49
+ loading: boolean;
50
+ handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
51
+ status: any;
52
+ error: any;
53
+ handleSubmit: (e: React.FormEvent) => Promise<void>;
54
+ isStatus204: boolean;
55
+ }
56
+ declare const useResetPassword: (apiUrl: string) => ResetPasswordHookReturn;
57
+
58
+ interface FormData$1 {
59
+ new_password?: string;
60
+ re_new_password?: string;
61
+ uid?: string;
62
+ token?: string;
63
+ }
64
+ interface PasswordConfirmHookReturn {
65
+ loading: boolean;
66
+ formData: FormData$1;
67
+ error: any;
68
+ onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
69
+ onSubmit: (e: React.FormEvent) => Promise<void>;
70
+ status: any;
71
+ isStatus204: boolean;
72
+ }
73
+ declare const usePasswordConfirm: (initialFields: FormData$1, apiUrl: string) => PasswordConfirmHookReturn;
74
+
75
+ interface FormData {
76
+ current_password?: string;
77
+ new_password?: string;
78
+ confirm_new_password?: string;
79
+ }
80
+ interface ChangePasswordHookReturn {
81
+ loading: boolean;
82
+ formData: FormData;
83
+ error: string | null;
84
+ onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
85
+ onSubmit: (e: React.FormEvent) => Promise<void>;
86
+ status: any;
87
+ }
88
+ declare const useChangeAuthenticatedUserPassword: (initialFields: FormData, apiUrl: string) => ChangePasswordHookReturn;
89
+
90
+ interface GoogleAuthHookReturn {
91
+ continueWithGoogle: () => Promise<void>;
92
+ authenticateWithGoogle: (state: string, code: string) => Promise<void>;
93
+ isAuthenticated: boolean | null;
94
+ error: any;
95
+ isStatus201: boolean;
96
+ loading: boolean;
97
+ }
98
+ declare const useGoogleAuth: (apiUrl: string) => GoogleAuthHookReturn;
99
+
100
+ interface FacebookAuthHookReturn {
101
+ continueWithFacebook: () => Promise<void>;
102
+ authenticateWithFacebook: (state: string, code: string) => Promise<void>;
103
+ isAuthenticated: boolean | null;
104
+ error: any;
105
+ isStatus201: boolean;
106
+ loading: boolean;
107
+ }
108
+ declare const useFacebookAuth: (apiUrl: string) => FacebookAuthHookReturn;
109
+
37
110
  type AuthProviderProps = {
38
111
  children: React$1.ReactNode;
39
112
  };
40
113
  declare const AuthProvider: React$1.FC<AuthProviderProps>;
41
114
 
42
- export { AuthProvider, useActivate, useLogin, useLogout, useSignup };
115
+ export { AuthProvider, useActivate, useAuthicatedUser, useChangeAuthenticatedUserPassword, useFacebookAuth, useGoogleAuth, useLogin, useLogout, usePasswordConfirm, useResetPassword, useSignup };