Skip to content

Commit a808a4b

Browse files
pufsamtstern
andauthored
Update email.js (#89)
Co-authored-by: Sam <[email protected]>
1 parent 67bda8b commit a808a4b

File tree

7 files changed

+19
-10
lines changed

7 files changed

+19
-10
lines changed

auth-next/custom.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ function signInCustom() {
1717

1818
const auth = getAuth(firebaseApp);
1919
signInWithCustomToken(auth, token)
20-
.then((user) => {
20+
.then((userCredential) => {
2121
// Signed in
22+
const user = userCredential.user;
2223
// ...
2324
})
2425
.catch((error) => {

auth-next/email.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ function signInWithEmailPassword() {
1818

1919
const auth = getAuth(firebaseApp);
2020
signInWithEmailAndPassword(auth, email, password)
21-
.then((user) => {
21+
.then((userCredential) => {
2222
// Signed in
23+
const user = userCredential.user;
2324
// ...
2425
})
2526
.catch((error) => {
@@ -38,8 +39,9 @@ function signUpWithEmailPassword() {
3839

3940
const auth = getAuth(firebaseApp);
4041
createUserWithEmailAndPassword(auth, email, password)
41-
.then((user) => {
42+
.then((userCredential) => {
4243
// Signed in
44+
const user = userCredential.user;
4345
// ...
4446
})
4547
.catch((error) => {

auth/custom.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ function signInCustom() {
88
var token = "token123";
99
// [START auth_sign_in_custom]
1010
firebase.auth().signInWithCustomToken(token)
11-
.then((user) => {
11+
.then((userCredential) => {
1212
// Signed in
13+
var user = userCredential.user;
1314
// ...
1415
})
1516
.catch((error) => {

auth/email.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ function signInWithEmailPassword() {
99
var password = "hunter2";
1010
// [START auth_signin_password]
1111
firebase.auth().signInWithEmailAndPassword(email, password)
12-
.then((user) => {
13-
// Signed in
12+
.then((userCredential) => {
13+
// Signed in
14+
var user = userCredential.user;
1415
// ...
1516
})
1617
.catch((error) => {
@@ -25,8 +26,9 @@ function signUpWithEmailPasswoerd() {
2526
var password = "hunter2";
2627
// [START auth_signup_password]
2728
firebase.auth().createUserWithEmailAndPassword(email, password)
28-
.then((user) => {
29+
.then((userCredential) => {
2930
// Signed in
31+
var user = userCredential.user;
3032
// ...
3133
})
3234
.catch((error) => {

snippets/auth-next/custom/auth_sign_in_custom.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import { getAuth, signInWithCustomToken } from "firebase/auth";
88

99
const auth = getAuth(firebaseApp);
1010
signInWithCustomToken(auth, token)
11-
.then((user) => {
11+
.then((userCredential) => {
1212
// Signed in
13+
const user = userCredential.user;
1314
// ...
1415
})
1516
.catch((error) => {

snippets/auth-next/email/auth_signin_password.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import { getAuth, signInWithEmailAndPassword } from "firebase/auth";
88

99
const auth = getAuth(firebaseApp);
1010
signInWithEmailAndPassword(auth, email, password)
11-
.then((user) => {
11+
.then((userCredential) => {
1212
// Signed in
13+
const user = userCredential.user;
1314
// ...
1415
})
1516
.catch((error) => {

snippets/auth-next/email/auth_signup_password.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import { getAuth, createUserWithEmailAndPassword } from "firebase/auth";
88

99
const auth = getAuth(firebaseApp);
1010
createUserWithEmailAndPassword(auth, email, password)
11-
.then((user) => {
11+
.then((userCredential) => {
1212
// Signed in
13+
const user = userCredential.user;
1314
// ...
1415
})
1516
.catch((error) => {

0 commit comments

Comments
 (0)