mirror of
https://github.com/friendica/friendica
synced 2025-04-27 12:30:11 +00:00
Refactor ExAuth for DICE
This commit is contained in:
parent
ee02be3d48
commit
8565617ea1
3 changed files with 75 additions and 41 deletions
|
@ -321,7 +321,8 @@ class User
|
|||
* @param string $password
|
||||
* @param bool $third_party
|
||||
* @return int User Id if authentication is successful
|
||||
* @throws Exception
|
||||
* @throws HTTPException\ForbiddenException
|
||||
* @throws HTTPException\NotFoundException
|
||||
*/
|
||||
public static function getIdFromPasswordAuthentication($user_info, $password, $third_party = false)
|
||||
{
|
||||
|
@ -356,7 +357,7 @@ class User
|
|||
return $user['uid'];
|
||||
}
|
||||
|
||||
throw new Exception(DI::l10n()->t('Login failed'));
|
||||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Login failed'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -370,7 +371,7 @@ class User
|
|||
*
|
||||
* @param mixed $user_info
|
||||
* @return array
|
||||
* @throws Exception
|
||||
* @throws HTTPException\NotFoundException
|
||||
*/
|
||||
private static function getAuthenticationInfo($user_info)
|
||||
{
|
||||
|
@ -414,7 +415,7 @@ class User
|
|||
}
|
||||
|
||||
if (!DBA::isResult($user)) {
|
||||
throw new Exception(DI::l10n()->t('User not found'));
|
||||
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue