example/example-usage.js
async function signin (username, password, options = {}) {
    let { agent } = options
    let user = await User.only({ username })
    let sign = user && await UserSign.only({ user })
    let valid = sign && await sign.testPassword(password)
    if (!valid) {
      throw new Error('Signin failed!')
    }
    await user.sync()
    session.signed = user
    return user
  }
async function signin (username, password, options = {}) {
    let { agent } = options
    let user = await User.only({ username })
    let sign = user && await UserSign.only({ user })
    let valid = sign && await sign.testPassword(password)
    if (!valid) {
      throw new Error('Signin failed!')
    }
    await user.sync()
    session.signed = user
    return user
  }
async function signin ( username , password , options = { } ) { let { agent } = options let user = await User . only ( { username } ) let sign = user && await UserSign . only ( { user } ) let valid = sign && await sign . testPassword ( password ) if ( ! valid ) { throw new Error ( 'Signin failed!' ) } await user . sync ( ) session . signed = user return user }
Start user session
Start user session