2014-01-24 109 views
1

我已經在我的網站上實現了FB連接,並且一切正常。;允許用戶更改密碼?

的過程是非常標準:

user clicks FB button on my website 
I capture the user's FB email, name 
I create a new user in my database with the users email and name 

在每個用戶的個人資料頁,我允許用戶更改他們的密碼。它發生在我身上,如果用戶使用FB(或Google)登錄,我不應該允許他們更改密碼,因爲1)我不能影響他們的FB密碼,2)他們確實沒有密碼在我的網站上。這是有道理的,還是我錯過了什麼?僅僅在他們的個人資料上填寫密碼錶格就足夠好了,還是有更好的方法來處理這個問題?

謝謝 -

+0

這取決於,如果您的網站只有在用戶的個人資料接受FB或登錄谷歌獨佔,那麼你就不會需要一個密碼字段,因爲在所有的認證是通過FB已經照顧。否則,除了FB之外,如果你需要自己的用戶登錄,我會建議你像下面的解決方案那樣做。 – har2vey

回答

1

我使用這個程序。

User clicks on FB button on my website 
I capture the user's FB email and name 
I create a new user in my database with the users email, name and random password 
Once user is logged in he can change the password 
Now the user have two options how to log in on my website 
- using FB authorization 
- using email and password 
    It's up to the user which one he use. 

希望這會有所幫助。

+0

好主意 - 非常感謝!我會以同樣的方式實施我的。 – user1309220

+0

但是,如果用戶更改他的電子郵件呢?那麼使用facebook-ID不是更好嗎? :) – TheYaXxE

+0

也許最好存儲FB-ID並檢查用戶登錄後電子郵件是否發生變化。 – sajushko