Q:

Rails : Devise gem authentication and EULA user acceptance

We are using Devise gem on our app and wondering how we could add a Contract acceptance in the process of the gem.
As Devise doesn't do that we thought of 2 solutions, one clean and one a bit dirty.

When user signs in, he is temporarly redirected to EULA page (using @resource from Devise). If accepts, sign in is successful and user enters the app, if rejected, the user is stuck on log in page.
When user signs in, he enters into the app and has a EULA page that he should accept. We then pass a flag to "yes" or "no" depending if he accepts or not. If not, he is redirected to sign in page.

The second solution is the easiest one but I feel it a bit unsecure (and perhaps server loads useless?).
The first one would be better, but we can't find any doc, tips to help us doing this and we are stuck in it.
Does anyone have developped similar thing? What's the best practice? 
Thanks!

A:

i think your second option is cleaner: create a bool field in your users table and check that (at login or in every request -> before_filter) and redirect if not set. that way, if you change your eula and the user has to re-accept it, you can clear all the bool flags in your users table to force your users to accept the new version.

