That sounds, well novel.
I would encourage you to review: (Free tier) https://auth0.com/
(Free tier) https://firebase.google.com/docs/auth/
Review any other proven and secure user auth solution ie. http://www.passportjs.org/
Questions to asks yourself: How it will scale ? Is it compatible with PAM/LDAP ? Let say you want at least two servers for scale or high availability.
How about social login ? How about forgotten password?
How you can delegate the work on it ? (in case, you want more people work on it in future)
For personal projects, get some paying clients first, worry later.