Compare commits
No commits in common. "79509135b7fdcd148acc0e376c3ae53695d24066" and "6d5817df8ee7ad7ebdf6412726f4e402e0c09198" have entirely different histories.
79509135b7
...
6d5817df8e
@ -106,12 +106,7 @@ class OAuthLoginController
|
|||||||
'exp' => (int)$token->getExpiresDate()->format('U'),
|
'exp' => (int)$token->getExpiresDate()->format('U'),
|
||||||
'nonce' => $token->getNonce(),
|
'nonce' => $token->getNonce(),
|
||||||
'sub' => $user->getId(),
|
'sub' => $user->getId(),
|
||||||
'email' => $user->getEmail(),
|
'email' => $user->getEmail()
|
||||||
'username' => $user->getUsername(),
|
|
||||||
'full_name' => $user->getFullName(),
|
|
||||||
'nickname' => $user->getNickname(),
|
|
||||||
'phone' => $user->getPhone(),
|
|
||||||
'id_number' => $user->getIdNumber()
|
|
||||||
];
|
];
|
||||||
$privateKey = file_get_contents(ROOT . '/' . $_ENV['JWT_RSA_PRIVATE_KEY']);
|
$privateKey = file_get_contents(ROOT . '/' . $_ENV['JWT_RSA_PRIVATE_KEY']);
|
||||||
$jwt = JWT::encode($payload, $privateKey, 'RS256');
|
$jwt = JWT::encode($payload, $privateKey, 'RS256');
|
||||||
|
@ -181,6 +181,7 @@ class UserController implements ISecured
|
|||||||
$user->setPlainPassword($newPassword);
|
$user->setPlainPassword($newPassword);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$user->setFullName($this->request->post('full_name'));
|
||||||
$user->setNickname($this->request->post('nickname'));
|
$user->setNickname($this->request->post('nickname'));
|
||||||
$user->setPhone($this->request->post('phone'));
|
$user->setPhone($this->request->post('phone'));
|
||||||
$user->setIdNumber($this->request->post('id_number'));
|
$user->setIdNumber($this->request->post('id_number'));
|
||||||
|
@ -168,7 +168,7 @@ class User extends Model implements IUser
|
|||||||
|
|
||||||
public function getDisplayName(): string
|
public function getDisplayName(): string
|
||||||
{
|
{
|
||||||
return $this->nickname ?: $this->fullName;
|
return $this->nickname ?: $this->fullName ?: $this->username ?: $this->email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function checkPassword(string $password): bool
|
public function checkPassword(string $password): bool
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
@section(main)
|
@section(main)
|
||||||
<h2>Account</h2>
|
<h2>Account</h2>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<form id="accountForm" action="/account" method="post" data-reload-on-success="true" data-observe-inputs="email,username,password_new,password_new_confirm,nickname,phone,id_number">
|
<form id="accountForm" action="/account" method="post" data-observe-inputs="email,username,password_new,password_new_confirm,full_name,nickname,phone,id_number">
|
||||||
<?php if ($user['password'] !== null && $user['google_sub'] !== null): ?>
|
<?php if ($user['password'] !== null && $user['google_sub'] !== null): ?>
|
||||||
<p class="justify small">Please confirm your identity with your password or with Google to modify your account.</p>
|
<p class="justify small">Please confirm your identity with your password or with Google to modify your account.</p>
|
||||||
<div class="inputWithButton">
|
<div class="inputWithButton">
|
||||||
@ -28,7 +28,7 @@
|
|||||||
<input type="password" class="text big fullWidth marginTop" name="password_new" placeholder="New password" minlength="6">
|
<input type="password" class="text big fullWidth marginTop" name="password_new" placeholder="New password" minlength="6">
|
||||||
<input type="password" class="text big fullWidth marginTop" name="password_new_confirm" placeholder="New password confirmation" minlength="6">
|
<input type="password" class="text big fullWidth marginTop" name="password_new_confirm" placeholder="New password confirmation" minlength="6">
|
||||||
<hr>
|
<hr>
|
||||||
<input type="text" class="text big fullWidth marginTop" name="full_name" placeholder="Full name" value="<?= $user['full_name'] ?>" disabled>
|
<input type="text" class="text big fullWidth marginTop" name="full_name" placeholder="Full name" value="<?= $user['full_name'] ?>">
|
||||||
<input type="text" class="text big fullWidth marginTop" name="nickname" placeholder="Nickname" value="<?= $user['nickname'] ?>">
|
<input type="text" class="text big fullWidth marginTop" name="nickname" placeholder="Nickname" value="<?= $user['nickname'] ?>">
|
||||||
<input type="text" class="text big fullWidth marginTop" name="phone" placeholder="Phone" value="<?= $user['phone'] ?>">
|
<input type="text" class="text big fullWidth marginTop" name="phone" placeholder="Phone" value="<?= $user['phone'] ?>">
|
||||||
<input type="text" class="text big fullWidth marginTop" name="id_number" placeholder="ID number" value="<?= $user['id_number'] ?>">
|
<input type="text" class="text big fullWidth marginTop" name="id_number" placeholder="ID number" value="<?= $user['id_number'] ?>">
|
||||||
|
Loading…
Reference in New Issue
Block a user