 		.then (savedToken) ->
 			return savedToken
 		.catch (err) ->
-			throw normalizeError(err)
+			throw normalizeAuthError(err)
 		.asCallback(callback)
 
 	###*

			.tap (body) ->
				userDetailsCache = body
			.catch (err) ->
				throw normalizeError(err)

	###*
	# @summary Return current logged in username

	twoFactor = require('./2fa')(deps, opts)
	exports = {}

	normalizeAuthError = (err) ->
		if err.statusCode == 401
			return new errors.ResinNotLoggedIn()
		else if err.code == 'ResinMalformedToken'
			return new errors.ResinNotLoggedIn()
		else
			return err
