仅允许用户使用 Omniauth 注册和登录
Only allow users to Register & Sign In with Omniauth
我正在构建一个应用程序,并已将 Devise 和 Omniauth 全部设置好,并使用 Twitter 和 Instagram 进行登录和注册。
但我想做的与 producthunt.com 类似,只允许用户使用 Omniauth(Twitter 和 Instagram)注册和登录,而不是手动输入他们的电子邮件和密码。是否可以禁用手动注册?并让 Omniauth 正常工作?
谢谢。
查看 devise.rb 初始值设定项:
# Tell if authentication through request.params is enabled. True by default.
# It can be set to an array that will enable params authentication only for the
# given strategies, for example, `config.params_authenticatable = [:database]` will
# enable it only for database (email + password) authentication.
# config.params_authenticatable = true
我正在构建一个应用程序,并已将 Devise 和 Omniauth 全部设置好,并使用 Twitter 和 Instagram 进行登录和注册。
但我想做的与 producthunt.com 类似,只允许用户使用 Omniauth(Twitter 和 Instagram)注册和登录,而不是手动输入他们的电子邮件和密码。是否可以禁用手动注册?并让 Omniauth 正常工作?
谢谢。
查看 devise.rb 初始值设定项:
# Tell if authentication through request.params is enabled. True by default.
# It can be set to an array that will enable params authentication only for the
# given strategies, for example, `config.params_authenticatable = [:database]` will
# enable it only for database (email + password) authentication.
# config.params_authenticatable = true