Skip to content

Commit e7ad6fb

Browse files
committed
Login with email in auths endpoint
1 parent 1a5f83c commit e7ad6fb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/controllers/auths_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class AuthsController < ApplicationController
1212
def show
1313
if params[:username].present? && params[:session_id].present?
1414
user = User.find_by(login: params[:username])
15+
user = User.find_by('lower(email) = ?', params[:username].downcase) unless user
1516
# Allows using oauth2 tokens of the new api for authenticating
1617
res = if user && Doorkeeper::AccessToken.find_by(resource_owner_id: user.id, token: params[:session_id])
1718
OK_MESSAGE

0 commit comments

Comments
 (0)