Guillermo - add path /user/verify [skip ci]
This commit is contained in:
parent
be2e492aa4
commit
e24f46c278
|
@ -34,7 +34,8 @@ class GetUserByIdController extends Controller {
|
|||
'name' => $user->name,
|
||||
'email' => $user->email,
|
||||
'signupDate' => $user->signupDate,
|
||||
'tickets' => $tickets->toArray()
|
||||
'tickets' => $tickets->toArray(),
|
||||
'verified' => !$user->verificationToken
|
||||
]);
|
||||
}
|
||||
}
|
|
@ -9,6 +9,7 @@ class SignUpController extends Controller {
|
|||
private $userEmail;
|
||||
private $userName;
|
||||
private $userPassword;
|
||||
private $verificationToken;
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
@ -64,20 +65,19 @@ class SignUpController extends Controller {
|
|||
$this->userName = Controller::request('name');
|
||||
$this->userEmail = Controller::request('email');
|
||||
$this->userPassword = Controller::request('password');
|
||||
$this->verificationToken = Hashing::generateRandomToken();
|
||||
}
|
||||
|
||||
public function createNewUserAndRetrieveId() {
|
||||
$userInstance = new User();
|
||||
|
||||
$token = Hashing::generateRandomToken();
|
||||
|
||||
$userInstance->setProperties([
|
||||
'name' => $this->userName,
|
||||
'signupDate' => Date::getCurrentDate(),
|
||||
'tickets' => 0,
|
||||
'email' => $this->userEmail,
|
||||
'password' => Hashing::hashPassword($this->userPassword),
|
||||
'verificationToken' => $token
|
||||
'verificationToken' => $this->verificationToken
|
||||
]);
|
||||
|
||||
return $userInstance->store();
|
||||
|
@ -88,7 +88,8 @@ class SignUpController extends Controller {
|
|||
|
||||
$mailSender->setTemplate(MailTemplate::USER_SIGNUP, [
|
||||
'to' => $this->userEmail,
|
||||
'name' => $this->userName
|
||||
'name' => $this->userName,
|
||||
'verificationToken' => $this->verificationToken
|
||||
]);
|
||||
|
||||
$mailSender->send();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<div>
|
||||
Welcome, {{name}} to our support center,
|
||||
your email is {{to}}
|
||||
your email is {{to}},
|
||||
your token is {{verificationToken}}
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<div>
|
||||
Bienvenido, {{name}} a nuestro centro de soporte,
|
||||
tu email es {{to}}
|
||||
tu email es {{to}},
|
||||
tu codigo de verificacion es {{verificationToken}}
|
||||
</div>
|
|
@ -12,11 +12,7 @@ describe'system/edit-settings' do
|
|||
"allow-attachments" => 1,
|
||||
"max-size" => 2,
|
||||
"language" => 'es',
|
||||
"no-reply-email" => 'testemail@hotmail.com',
|
||||
"smtp-host" => 'www.opensupports.com',
|
||||
"smtp-port" => 18,
|
||||
"smtp-user" => 'admin',
|
||||
"smtp-pass" => 'pass1234',
|
||||
"no-reply-email" => 'testemail@hotmail.com'
|
||||
})
|
||||
|
||||
(result['status']).should.equal('success')
|
||||
|
@ -39,18 +35,6 @@ describe'system/edit-settings' do
|
|||
row = $database.getRow('setting', 'no-reply-email', 'name')
|
||||
(row['value']).should.equal('testemail@hotmail.com')
|
||||
|
||||
row = $database.getRow('setting', 'smtp-host', 'name')
|
||||
(row['value']).should.equal('www.opensupports.com')
|
||||
|
||||
row = $database.getRow('setting', 'smtp-port', 'name')
|
||||
(row['value']).should.equal('18')
|
||||
|
||||
row = $database.getRow('setting', 'smtp-user', 'name')
|
||||
(row['value']).should.equal('admin')
|
||||
|
||||
row = $database.getRow('setting', 'smtp-pass', 'name')
|
||||
(row['value']).should.equal('pass1234')
|
||||
|
||||
request('/user/logout')
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue