refactored login controller to use authentication service