$u]); //$this->currentUser = 'principals/' . (User::first()->id ?? 'dummy'); //zreturn true; if (!$username) { return false; // no credentials supplied } // Allow login via e-mail OR the "short" user name $user = User::where('email', $username) ->orWhere('name', $username) ->first(); if (!$user || !Hash::check($password, $user->password)) { return false; // invalid creds } // Log the user into Laravel so policies / Auth::user() work Auth::setUser($user); // Tell Sabre which principal this login maps to (ULID-based) $this->currentUser = 'principals/' . $user->id; return true; } /** * Optional — Sabre may call this when it needs to know * who is currently authenticated. */ public function getCurrentUser(): ?string { return $this->currentUser; } }