Skip to content

Commit

Permalink
[267] Fix bug: raise error when user login to another account if he i…
Browse files Browse the repository at this point in the history
…s logined
  • Loading branch information
zipofar committed Aug 1, 2023
1 parent df0dea1 commit 4883d9f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/uffizzi/cli/login.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,23 @@ def initialize(options)
end

def run
logout
return perform_email_login if @options[:email]

perform_browser_login
end

private

def logout
return unless Uffizzi::AuthHelper.signed_in?

server = ConfigFile.read_option(:server)
destroy_session(server)

AuthHelper.sign_out
end

def perform_email_login
Uffizzi.ui.say('Login to Uffizzi server.')
username = Uffizzi::LoginHelper.set_username(@options)
Expand Down

0 comments on commit 4883d9f

Please sign in to comment.