Skip to content

Update email.js #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion auth-next/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ function signInCustom() {

const auth = getAuth(firebaseApp);
signInWithCustomToken(auth, token)
.then((user) => {
.then((userCredential) => {
// Signed in
const user = userCredential.user;
// ...
})
.catch((error) => {
Expand Down
6 changes: 4 additions & 2 deletions auth-next/email.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ function signInWithEmailPassword() {

const auth = getAuth(firebaseApp);
signInWithEmailAndPassword(auth, email, password)
.then((user) => {
.then((userCredential) => {
// Signed in
const user = userCredential.user;
// ...
})
.catch((error) => {
Expand All @@ -38,8 +39,9 @@ function signUpWithEmailPassword() {

const auth = getAuth(firebaseApp);
createUserWithEmailAndPassword(auth, email, password)
.then((user) => {
.then((userCredential) => {
// Signed in
const user = userCredential.user;
// ...
})
.catch((error) => {
Expand Down
3 changes: 2 additions & 1 deletion auth/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ function signInCustom() {
var token = "token123";
// [START auth_sign_in_custom]
firebase.auth().signInWithCustomToken(token)
.then((user) => {
.then((userCredential) => {
// Signed in
var user = userCredential.user;
// ...
})
.catch((error) => {
Expand Down
8 changes: 5 additions & 3 deletions auth/email.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ function signInWithEmailPassword() {
var password = "hunter2";
// [START auth_signin_password]
firebase.auth().signInWithEmailAndPassword(email, password)
.then((user) => {
// Signed in
.then((userCredential) => {
// Signed in
var user = userCredential.user;
// ...
})
.catch((error) => {
Expand All @@ -25,8 +26,9 @@ function signUpWithEmailPasswoerd() {
var password = "hunter2";
// [START auth_signup_password]
firebase.auth().createUserWithEmailAndPassword(email, password)
.then((user) => {
.then((userCredential) => {
// Signed in
var user = userCredential.user;
// ...
})
.catch((error) => {
Expand Down
3 changes: 2 additions & 1 deletion snippets/auth-next/custom/auth_sign_in_custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import { getAuth, signInWithCustomToken } from "firebase/auth";

const auth = getAuth(firebaseApp);
signInWithCustomToken(auth, token)
.then((user) => {
.then((userCredential) => {
// Signed in
const user = userCredential.user;
// ...
})
.catch((error) => {
Expand Down
3 changes: 2 additions & 1 deletion snippets/auth-next/email/auth_signin_password.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import { getAuth, signInWithEmailAndPassword } from "firebase/auth";

const auth = getAuth(firebaseApp);
signInWithEmailAndPassword(auth, email, password)
.then((user) => {
.then((userCredential) => {
// Signed in
const user = userCredential.user;
// ...
})
.catch((error) => {
Expand Down
3 changes: 2 additions & 1 deletion snippets/auth-next/email/auth_signup_password.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import { getAuth, createUserWithEmailAndPassword } from "firebase/auth";

const auth = getAuth(firebaseApp);
createUserWithEmailAndPassword(auth, email, password)
.then((user) => {
.then((userCredential) => {
// Signed in
const user = userCredential.user;
// ...
})
.catch((error) => {
Expand Down