Skip to content

Commit

Permalink
updated action signin to redirect signed in users
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhanginwa committed Dec 18, 2023
1 parent 0b547af commit 1b63121
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/controllers/ruby_auth_metamask/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ def initialize(sig_obj, v_value)

class UsersController < ApplicationController
def signin
@message = "ruby_auth_metamask:#{SecureRandom.hex}"
session[:message] = @message
if session[:user_id].nil?
@message = "ruby_auth_metamask:#{SecureRandom.hex}"
session[:message] = @message
else
redirect_to main_app.root_path
end
end

def verify
Expand Down

0 comments on commit 1b63121

Please sign in to comment.