use mobiledevice as login object for mobile api

This commit is contained in:
2022-02-22 14:41:16 +01:00
parent 356fc1f0fd
commit 530accd8bf
8 changed files with 90 additions and 71 deletions

View File

@@ -30,7 +30,7 @@ class LoginController extends RestController
$form->load(\Yii::$app->request->post(), '');
if (!$form->validate()) {
throw new BadRequestHttpException("Hibás e-mail cím vagy jelszó!");
throw new BadRequestHttpException("Hibás bejelentkezés " . print_r($form->getErrors( ),true));
}
/** @var Jwt $jwt */
@@ -47,7 +47,7 @@ class LoginController extends RestController
->identifiedBy('A989C57D19E2AF756BA9585AC4CFAF7974AE3D2BCA7CCA7307B39AB28CC7C2C8', true)// Configures the id (jti claim), replicating as a header item
->issuedAt($time)// Configures the time that the token was issue (iat claim)
->expiresAt($time + $validFor)// Configures the expiration time of the token (exp claim)
->withClaim('uid', $form->getCustomer()->getId())// Configures a new claim, called "uid"
->withClaim('uid', $form->getMobileDevice()->getId())// Configures a new claim, called "uid"
->getToken($signer, $key); // Retrieves the generated token
return $this->asJson([