Skip to content

Commit

Permalink
Avoid failing on undefined variable for invalid record (lynndylanhurl…
Browse files Browse the repository at this point in the history
  • Loading branch information
MaicolBen committed Jun 22, 2020
1 parent 30a1aff commit b409997
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def update_auth_header

else
unless @resource.reload.valid?
@resource = resource_class.find(@resource.to_param) # errors remain after reload
@resource = @resource.class.find(@resource.to_param) # errors remain after reload
# if we left the model in a bad state, something is wrong in our app
unless @resource.valid?
raise DeviseTokenAuth::Errors::InvalidModel, "Cannot set auth token in invalid model. Errors: #{@resource.errors.full_messages}"
Expand Down

0 comments on commit b409997

Please sign in to comment.