prototpe of user auth
(cherry picked from commit 874fc08)