Merge pull request #483 from juandefelix/user-from-omniauth
Añadido :terms_of_service a User::first_or_create_for_oauth
This commit is contained in:
@@ -68,7 +68,8 @@ class User < ActiveRecord::Base
|
||||
user = User.new(
|
||||
username: auth.info.nickname || auth.extra.raw_info.name.parameterize('-') || auth.uid,
|
||||
email: email ? email : "#{OMNIAUTH_EMAIL_PREFIX}-#{auth.uid}-#{auth.provider}.com",
|
||||
password: Devise.friendly_token[0,20]
|
||||
password: Devise.friendly_token[0,20],
|
||||
terms_of_service: '1'
|
||||
)
|
||||
user.skip_confirmation!
|
||||
user.save!
|
||||
|
||||
@@ -7,5 +7,6 @@
|
||||
<%= link_to t("omniauth.twitter.sign_up"), user_omniauth_authorize_path(:twitter), class: "button-twitter button radius expand" %>
|
||||
<%= link_to t("omniauth.facebook.sign_up"), user_omniauth_authorize_path(:facebook), class: "button-facebook button radius expand" %>
|
||||
<%= link_to t("omniauth.google_oauth2.sign_up"), user_omniauth_authorize_path(:google_oauth2), class: "button-google button radius expand" %>
|
||||
<p>Al hacer login con una red social, usted está aceptando los términos legales.</p>
|
||||
<hr/>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user