mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 07:10:29 -04:00
Fix broken updated timestamps in OPDS feeds, and fix and add some type hints.
This commit is contained in:
parent
34e35194d8
commit
06b82cdaaa
15 changed files with 344 additions and 300 deletions
|
@ -145,13 +145,16 @@ class User{
|
|||
}
|
||||
|
||||
/**
|
||||
* Get a `User` if they are considered "registered".
|
||||
*
|
||||
* We consider a `User` "registered" if they have a row in the `Benefits` table. Emails without that row may only be signed up for the newsletter, and thus are not considered to be "registered" users.
|
||||
*
|
||||
* @param ?string $identifier Either an email or a UUID (i.e., an api key).
|
||||
*
|
||||
* @throws Exceptions\UserNotFoundException
|
||||
* @throws Exceptions\PasswordRequiredException
|
||||
*/
|
||||
public static function GetIfRegistered(?string $identifier, ?string $password = null): User{
|
||||
// We consider a user "registered" if they have a row in the Benefits table.
|
||||
// Emails without that row may only be signed up for the newsletter and thus are not "registered" users
|
||||
// The identifier is either an email or a UUID (api key)
|
||||
if($identifier === null){
|
||||
throw new Exceptions\UserNotFoundException();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue