Its bad idea, to raise exception, if no "User" found with such id #365

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

nogenhat commented Nov 2, 2012

For example, u logged, on the site, then destroy your auth model(User for simplicity),
if user try go to website, rails will render 500 error, cause find raise exception "No record found",
better user experience is just redirect to not_authenticated path.

Contributor

kuboon commented Nov 5, 2012

I respect this commit 228cf83 but actually I don't know mongoid

login_from_session method don't raise exception because it is rescued.

Collaborator

kirs commented Oct 1, 2013

I agree with @kuboon that ActiveRecord::RecordNotFound which can be thrown from find will be rescued anyway (https://github.com/NoamB/sorcery/pull/365/files#diff-4e590bf6cab519124cc7e3a6832abe2dL118).

kirs closed this Oct 1, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment