Refactor Basic Auth into a type