![](/img/trans.png)
[英]How to know if user is authenticated with Google auth using Firebase on Nodejs?
[英]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.