We're upgrading an application that has two ways of authenticating users.
- Controllers that have the
before_filter :authenticate_user!
callback and are accessed like a standard Rails site. - Controllers inside an API module that are accessed via JSON by client side applications. All the routes have the prefix
/api/session_id/
except the authenticate action that only has the prefix/api
.
Both ways authenticate the users using the User
model.
Is there a way to configure devise to support them both? How?
Note: I don't want to create users through JSON. I just want to authenticate them.