fleshed out some authentication stuff that needs testing