refactored auth
WIP: digest auth