Skip to content

Commit

Permalink
Updated redirect url paths
Browse files Browse the repository at this point in the history
  • Loading branch information
kobaltz committed Feb 22, 2024
1 parent faa34cb commit af2c500
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
action_auth (0.2.15)
action_auth (0.3.0)
bcrypt (~> 3.1.0)
rails (~> 7.1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ class EmailVerificationsController < ApplicationController

def show
@user.update! verified: true
redirect_to main_app.root_path, notice: "Thank you for verifying your email address"
redirect_to sign_in_path, notice: "Thank you for verifying your email address"
end

def create
user = ActionAuth::User.find_by(email: params[:email])
UserMailer.with(user: user).email_verification.deliver_later if user
redirect_to main_app.root_path, notice: "We sent a verification email to your email address"
redirect_to sign_in_path, notice: "We sent a verification email to your email address"
end

private
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/action_auth/identity/emails_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ def user_params
def redirect_to_root
if @user.email_previously_changed?
resend_email_verification
redirect_to main_app.root_path, notice: "Your email has been changed"
redirect_to sign_in_path, notice: "Your email has been changed. Check your email to verify your email."
else
redirect_to main_app.root_path
redirect_to sign_in_path
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def create
send_password_reset_email
redirect_to sign_in_path, notice: "Check your email for reset instructions"
else
redirect_to new_identity_password_reset_path, alert: "You can't reset your password until you verify your email"
redirect_to sign_in_path, alert: "You can't reset your password until you verify your email"
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/action_auth/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def edit

def update
if @user.update(user_params)
redirect_to main_app.root_path, notice: "Your password has been changed"
redirect_to sign_in_path, notice: "Your password has been changed"
else
render :edit, status: :unprocessable_entity
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/action_auth/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ def create
if @user.save
if ActionAuth.configuration.verify_email_on_sign_in
send_email_verification
redirect_to main_app.root_path, notice: "Welcome! You have signed up successfully. Please check your email to verify your account."
redirect_to sign_in_path, notice: "Welcome! You have signed up successfully. Please check your email to verify your account."
else
session_record = @user.action_auth_sessions.create!
cookies.signed.permanent[:session_token] = { value: session_record.id, httponly: true }

redirect_to main_app.root_path, notice: "Welcome! You have signed up successfully"
redirect_to sign_in_path, notice: "Welcome! You have signed up successfully"
end
else
render :new, status: :unprocessable_entity
Expand Down
2 changes: 1 addition & 1 deletion lib/action_auth/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ActionAuth
VERSION = "0.2.15"
VERSION = "0.3.0"
end

0 comments on commit af2c500

Please sign in to comment.