Class: NoPassword::EmailAuthenticationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- NoPassword::EmailAuthenticationsController
show all
- Defined in:
- app/controllers/nopassword/email_authentications_controller.rb
Instance Method Summary
collapse
Instance Method Details
#create ⇒ Object
16
17
18
19
20
21
22
23
24
|
# File 'app/controllers/nopassword/email_authentications_controller.rb', line 16
def create
if @email_authentication.valid?
deliver_authentication @email_authentication
@verification = @email_authentication.verification
render :edit, status: :accepted
else
render :new, status: :unprocessable_entity
end
end
|
#destroy ⇒ Object
26
27
28
|
# File 'app/controllers/nopassword/email_authentications_controller.rb', line 26
def destroy
@verification.destroy!
end
|
#new ⇒ Object
9
10
|
# File 'app/controllers/nopassword/email_authentications_controller.rb', line 9
def new
end
|
#show ⇒ Object
12
13
14
|
# File 'app/controllers/nopassword/email_authentications_controller.rb', line 12
def show
redirect_to url_for(action: :new)
end
|
#update ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
|
# File 'app/controllers/nopassword/email_authentications_controller.rb', line 30
def update
if @verification.valid?
verification_succeeded @verification.data
elsif @verification.has_expired?
verification_expired @verification
elsif @verification.has_exceeded_attempts?
verification_exceeded_attempts @verification
else
render :edit, status: :unprocessable_entity
end
end
|