moving core logic to new auth
core auth logic replaced, debugging