$user->loginPasswordless()

Login the user without a password.

Example

// simple login form submission example
if($username = get('username') and $password = get('password')) {

  $user = $site->user($username);

  // verify access with a different method like
  // OAuth, IndieAuth, email or SMS token etc.
  myCustomAuthProvider();

  if($user and $user->loginPasswordless()) {
    // redirect to the homepage
    // or any other page
    go();
  } else {
    echo 'login process failed';
  }

}

Is something missing or incorrect? Edit this page on Github…