Refactor Token Validation from App Layer to SQL Layer
|Assignee:||Pavan Rikhi||% Done:|
|Target version:||v2.0.0 - Post-Migration Issues|
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.