Sha256: 7e433cb2ebb665b844e6be8d9cec496f0b3c0244252e1d244c5d5d09607207af

Contents?: true

Size: 664 Bytes

Versions: 48

Compression:

Stored size: 664 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # A form object used to fisnish signup from omniauth data
  class OmniauthRegistrationForm < Form
    mimic :user

    attribute :email, String
    attribute :name, String
    attribute :provider, String
    attribute :uid, String
    attribute :tos_agreement, Boolean
    attribute :oauth_signature, String

    validates :email, presence: true
    validates :name, presence: true
    validates :provider, presence: true
    validates :uid, presence: true

    def self.create_signature(provider, uid)
      Digest::MD5.hexdigest("#{provider}-#{uid}-#{Rails.application.secrets.secret_key_base}")
    end
  end
end

Version data entries

48 entries across 48 versions & 2 rubygems

Version Path
decidim-core-0.6.3 app/forms/decidim/omniauth_registration_form.rb
decidim-0.6.3 decidim-core/app/forms/decidim/omniauth_registration_form.rb
decidim-core-0.6.2 app/forms/decidim/omniauth_registration_form.rb
decidim-0.6.2 decidim-core/app/forms/decidim/omniauth_registration_form.rb
decidim-core-0.6.1 app/forms/decidim/omniauth_registration_form.rb
decidim-0.6.1 decidim-core/app/forms/decidim/omniauth_registration_form.rb
decidim-core-0.6.0 app/forms/decidim/omniauth_registration_form.rb
decidim-0.6.0 decidim-core/app/forms/decidim/omniauth_registration_form.rb
decidim-core-0.5.1 app/forms/decidim/omniauth_registration_form.rb
decidim-0.5.1 decidim-core/app/forms/decidim/omniauth_registration_form.rb
decidim-core-0.5.0 app/forms/decidim/omniauth_registration_form.rb
decidim-0.5.0 decidim-core/app/forms/decidim/omniauth_registration_form.rb
decidim-core-0.4.4 app/forms/decidim/omniauth_registration_form.rb
decidim-core-0.4.2 app/forms/decidim/omniauth_registration_form.rb
decidim-core-0.4.1 app/forms/decidim/omniauth_registration_form.rb
decidim-core-0.4.3 app/forms/decidim/omniauth_registration_form.rb
decidim-core-0.4.0 app/forms/decidim/omniauth_registration_form.rb
decidim-core-0.3.2 app/forms/decidim/omniauth_registration_form.rb
decidim-core-0.3.1 app/forms/decidim/omniauth_registration_form.rb
decidim-core-0.3.0 app/forms/decidim/omniauth_registration_form.rb