WIP: Some more work on authentication