簡體   English   中英

使用 firebase Nodejs 客戶端時如何處理 Auth 變量機制

[英]How to handle Auth variable mechanism while using firebase Nodejs client

我正在使用 Firebase Node.js 客戶端,每個 function 都在index.js內。

我的用戶 function firebase.auth().signInWithEmailAndPassword(email, password)也在 Node.js 的index.js文件中。

如果我正在驗證第一個用戶,然后是第二個用戶,然后是第三個用戶,以此類推,那么我無法為用戶保留 auth 變量,因為它正在相互覆蓋。

I went through the Firebase docs they are using client side JavaScript authentication codes but I do not want to use client visible codes as I have to write the other database transaction codes inside JavaScript itself if I use JavaScript authentication.

我想通過 Node.js 本身進行身份驗證,然后允許持久化 auth 變量以用於安全規則。

感謝你的幫助。 我從三周開始就一直在嘗試,但這對我來說並沒有發生。

您正在使用客戶端庫,似乎您誤解了 Firebase 身份驗證的工作原理。 身份驗證后端由 Firebase 本身處理,除了根據您所在的平台使用他們的客戶端庫外,您無需做任何事情。

使用 Firebase 身份驗證的主要好處之一是不必自己在后端處理用戶身份驗證,我強烈建議您再次閱讀文檔: https://firebase.google.com/docs/auth

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM