Sha256: c72a5164bfcadbf65a3a362626b829578555fbe926c4506ca441ae37cb084caf

Contents?: true

Size: 704 Bytes

Versions: 12

Compression:

Stored size: 704 Bytes

Contents

class Identity::EmailVerificationsController < ApplicationController
  skip_before_action :authenticate, only: :edit

  before_action :set_<%= singular_table_name %>, only: :edit

  def edit
    @<%= singular_table_name %>.update! verified: true
  end

  def create
    IdentityMailer.with(<%= singular_table_name %>: Current.<%= singular_table_name %>).email_verify_confirmation.deliver_later
  end

  private
    def set_<%= singular_table_name %>
      @<%= singular_table_name %> = <%= class_name %>.where(email: params[:email]).find_signed!(params[:token], purpose: params[:email])
    rescue
      render json: { error: "That email verification link is invalid" }, status: :bad_request
    end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
authentication-zero-2.11.1 lib/generators/authentication/templates/controllers/api/identity/email_verifications_controller.rb.tt
authentication-zero-2.11.0 lib/generators/authentication/templates/controllers/api/identity/email_verifications_controller.rb.tt
authentication-zero-2.10.0 lib/generators/authentication/templates/controllers/api/identity/email_verifications_controller.rb.tt
authentication-zero-2.9.3 lib/generators/authentication/templates/controllers/api/identity/email_verifications_controller.rb.tt
authentication-zero-2.9.2 lib/generators/authentication/templates/controllers/api/identity/email_verifications_controller.rb.tt
authentication-zero-2.9.1 lib/generators/authentication/templates/controllers/api/identity/email_verifications_controller.rb.tt
authentication-zero-2.9.0 lib/generators/authentication/templates/controllers/api/identity/email_verifications_controller.rb.tt
authentication-zero-2.8.4 lib/generators/authentication/templates/controllers/api/identity/email_verifications_controller.rb.tt
authentication-zero-2.8.3 lib/generators/authentication/templates/controllers/api/identity/email_verifications_controller.rb.tt
authentication-zero-2.8.2 lib/generators/authentication/templates/controllers/api/identity/email_verifications_controller.rb.tt
authentication-zero-2.8.1 lib/generators/authentication/templates/controllers/api/identity/email_verifications_controller.rb.tt
authentication-zero-2.8.0 lib/generators/authentication/templates/controllers/api/identity/email_verifications_controller.rb.tt