@kylewmahan Sweet! You should try using JWT for generating the auth codes, so that you don't need to store anything! Basically you generate a signed string with all of the data you need (user, scope, expiration, etc), and that is the auth code. That way you can get the data from the auth code without needing to look anything up in the database. Check out how my token endpoint does it:
https://github.com/aaronpk/IndieAuth-Token-Endpoint/blob/master/controllers/controller.php#L52
https://github.com/aaronpk/IndieAuth-Token-Endpoint/blob/master/controllers/controller.php#L100
There's more background on this concept here: http://lucumr.pocoo.org/2013/11/17/my-favorite-database/
WeChat ID
aaronpk_tv