I think you can try to add a column in your SQL table where the value change when the user first login (example TRUE or FALSE / 1 or 0 value from column Login)...
You can look this pic
http://s13.postimg.org/yuquyht1j/Capture.png[
^]
So the logic is you must INSERT value 1 in "login" column when user first login and your auth func must check whether the value of "login" column is 1 or 0...
I think this is the simplest trick...