2014-01-24 113 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