You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 5, 2023. It is now read-only.
Hi, sorry to file this under issues, but I thought this might be a common enough question.
I'm attempting to do an auto-login after password-reset within devise's passwords controller.
I can't figure out how to do this, and thought perhaps you could suggest an approach.
The snippet looks a lot like the standard passwords controller, but I'm returning a JSON only response.
# PUT /reset
def update
self.resource = resource_class.reset_password_by_token(resource_params)
if resource.errors.empty?
resource.unlock_access! if unlockable?(resource)
message = resource.active_for_authentication? ? :updated : :updated_not_active
sign_in(resource_name, resource)
# ***TODO: Do an OAuth2 login here***
render :json => { success: true, message: message, auth: @access_tokens }
else
render :json => { success: false, errors: resource.errors }, :status => :bad_request
end
end