You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`loading`: A `boolean` to indicate whether the the authentication state is still being loaded
33
33
-`error`: Any `firebase.auth.Error` returned by Firebase when trying to load the user, or `undefined` if there is no error
34
34
35
-
#### If you are registering or logingIn the user for the first time consider using [useRegister](#useregister), [useLogin](#uselogin)
35
+
#### If you are registering or signing in the user for the first time consider using [useCreateUserWithEmailAndPassword](#usecreateuserwithemailandpassword), [useSignInWithEmailAndPassword](#usesigninwithemailandpassword)
Create a user with email and password. Wraps the underlying `firebase.auth().createUserWithEmailAndPassword` method and provides additional `loading` and `error` information.
For full full example [check here](#register-and-login-hook-usage)
165
+
Login a user with email and password. Wraps the underlying `firebase.auth().signInWithEmailAndPassword` method and provides additional `loading` and `error` information.
120
166
121
-
Register a user and receive the user credentials
122
-
123
-
The `useLogin` hook takes the following parameters:
167
+
The `useSignInWithEmailAndPassword` hook takes the following parameters:
124
168
125
169
-`auth`: `firebase.auth.Auth` instance for the app you would like to monitor
126
-
-`email`: `string` email of the user
127
-
-`password`: `string` password of the user
128
170
129
171
Returns:
130
172
131
-
-`loggedInUser`: The `loggedInUser` if data is received or `undefined` if not
132
-
-`loading`: A `boolean` to indicate whether the the login process is completed or it's yet processing
133
-
-`error`: `any` returned by Firebase when trying to register the user, or `undefined` if there is no error
134
-
-`login`: `void` a function you can call to start the login process
173
+
-`signInWithEmailAndPassword(email: string, password: string)`: a function you can call to start the login
174
+
-`user`: The `firebase.User` if the user was logged in or `undefined` if not
175
+
-`loading`: A `boolean` to indicate whether the the user login is processing
176
+
-`error`: Any `firebase.auth.Error` returned by Firebase when trying to login the user, or `undefined` if there is no error
0 commit comments