FIX: handle nil user value on password reset

This commit is contained in:
Arpit Jalan 2018-11-20 21:49:47 +05:30
parent 592f8c1637
commit 22a7f1e7f2
1 changed files with 3 additions and 3 deletions

View File

@ -546,10 +546,10 @@ class UsersController < ApplicationController
end
else
render json: {
is_developer: UsernameCheckerService.is_developer?(@user.email),
admin: @user.admin?,
is_developer: UsernameCheckerService.is_developer?(@user&.email),
admin: @user&.admin?,
second_factor_required: !valid_second_factor,
backup_enabled: @user.backup_codes_enabled?
backup_enabled: @user&.backup_codes_enabled?
}
end
end