Edge case 500 when passing bad token to auth endpoint

pull/336/head
Rick Carlino 2017-07-05 08:52:13 -05:00
parent 79ae3b5de0
commit dee128c6b3
1 changed files with 5 additions and 5 deletions

View File

@ -17,12 +17,12 @@ module Api
end
def auth_params
params[:user] ||= {}
user = params.as_json.deep_symbolize_keys.fetch(:user, {})
{ email: (params[:user][:email] || "").downcase,
password: params[:user][:password],
credentials: params[:user][:credentials],
agree_to_terms: !!params[:user][:agree_to_terms],
{ email: user.fetch(:email, "").downcase,
password: user[:password],
credentials: user[:credentials],
agree_to_terms: !!user[:agree_to_terms],
host: $API_URL }
end
end