Refactor #1200

Refactor Token Validation from App Layer to SQL Layer

Added by Pavan Rikhi about 2 years ago. Updated 12 months ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:Pavan Rikhi% Done:


Category:GeneralSpent time:-
Target version:v2.0.0 - Post-Migration Issues
Easy Pickings:


make token validation possible in a single sql transaction. Either change validateToken to use the AppSQL monad insted of the App monad, or add another function.

Have to think about how to do model validation if token validation is only in the SQL monad. We'd need the token validation to return an error before model validation would return an error.

Either way, we'll have to have token validation throw an exception to abort the SQL transaction. This could be caught & handled by the runDB helper so handlers don't have to think about it when they call validateToken.


#1 Updated by Pavan Rikhi 12 months ago

Alternatively, I believe new versions of servant support IO in the authhandler. We could move the valiateToken functionality here.

Also available in: Atom PDF