Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

wrong code #399

Open
Open
@AdamTeodoro

Description

@AdamTeodoro

Github documentation page:

// These samples are intended for Web so this import would normally be
// done in HTML however using modules here is more convenient for
// ensuring sample correctness offline.
importfirebasefrom"firebase/app";
import"firebase/auth";
functionsetPersistenceSession(){
varemail="...";
varpassword="...";
// [START auth_set_persistence_session]
firebase.auth().setPersistence(firebase.auth.Auth.Persistence.SESSION)
.then(()=>{
// Existing and future Auth states are now persisted in the current
// session only. Closing the window would clear any existing state even
// if a user forgets to sign out.
// ...
// New sign-in will be persisted with session persistence.
returnfirebase.auth().signInWithEmailAndPassword(email,password);
})
.catch((error)=>{
// Handle Errors here.
varerrorCode=error.code;
varerrorMessage=error.message;
});
// [END auth_set_persistence_session]
}

Firebase documentation page:

https://firebase.google.com/docs/auth/web/auth-state-persistence?hl=pt-br#web_1

wrong imports: ❌

import firebase from "firebase/app";import "firebase/auth";

correctly imports: ✅

import firebase from "firebase/compat/app"; // Or the modular importimport "firebase/compat/auth"; // Or the modular import for getAuth

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp