Skip to content

Kirby 4.3.0


Logs the user in without checking the password

$user->loginPasswordless(Kirby\Session\Session|array|null $session = null): void


Name Type Default Description
$session Kirby\Session\Session|array|null null Session options or session object to set the user in

Parent class



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

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

  if($user) {
    // verify access with a different method like
    // OAuth, IndieAuth, email or SMS token etc.

    // now that that succeeded, log the user in without checking the provided password
    // NOTE: Only use this if you have verified access in other ways like in this example!

    // redirect to the homepage
    // or any other page
  } else {
    echo 'login process failed';