     if Q.isPromiseAlike api.AuthImpl.findUser
       api.AuthImpl.findUser login
     else
-      Q.nfcall api.AuthImpl.findUser, login
+      Q.ninvoke api.AuthImpl, 'findUser', login
 
   _jwtPayloadPromise = (user) ->
     if Q.isPromiseAlike api.AuthImpl.jwtPayload
       api.AuthImpl.jwtPayload user
     else
-      Q.nfcall api.AuthImpl.jwtPayload, user
+      Q.ninvoke api.AuthImpl, 'jwtPayload', user
 
   signIn = (login, password, callback) ->
     deferred = Q.defer()

    if Q.isPromiseAlike api.AuthImpl.matchPassword
      api.AuthImpl.matchPassword passwordHash, password
    else
      Q.nfcall api.AuthImpl.matchPassword, passwordHash, password

  matchPassword = (passwordHash, password, callback) ->
    deferred = Q.defer()


  _encodePassword =
    scrypt: (password) ->
      Q.ninvoke(scrypt, 'passwordHash', password, config.scrypt.maxtime)

  _encodePasswordPromise = (password) ->
    if Q.isPromiseAlike api.AuthImpl.encodePassword
      api.AuthImpl.encodePassword password
    else
      Q.ninvoke api.AuthImpl, 'encodePassword', password

  encodePassword = (password, callback) ->
    if api.AuthImpl and api.AuthImpl.encodePassword
