[DEV-328] Fix array offset on null in /user/login (#1185)

This commit is contained in:
Maximiliano Redigonda 2022-05-02 16:48:14 -03:00 committed by GitHub
parent a5da776d27
commit a74d6ab4d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ class User extends DataStore {
public static function authenticate($userEmail, $userPassword) {
$user = User::getUser($userEmail, 'email');
return ($user && Hashing::verifyPassword($userPassword, $user->password) && !$user->notRegistered) ? $user : new NullDataStore();
return (!$user->isNull() && Hashing::verifyPassword($userPassword, $user->password) && !$user->notRegistered) ? $user : new NullDataStore();
}
public static function getProps() {

View File

@ -27,7 +27,7 @@ describe '/staff/assign-ticket' do
#end
it 'should assign ticket if everything is okey' do
it 'should assign ticket if everything is okay' do
ticket1 = $database.getRow('ticket', 'ticket_to_assing_1', 'title')
ticket2 = $database.getRow('ticket', 'ticket_to_assing_2', 'title')
ticket3 = $database.getRow('ticket', 'ticket_to_assing_3', 'title')

View File

@ -6,7 +6,7 @@ describe '/ticket/seen' do
Scripts.login($staff[:email], $staff[:password], true)
Scripts.assignTicket(ticket['ticket_number'])
it 'should change unread if everything is okey ' do
it 'should change unread if everything is okay ' do
result = request('/ticket/seen', {
ticketNumber: ticket['ticket_number'],
@ -38,7 +38,7 @@ describe '/ticket/seen' do
Scripts.logout()
Scripts.login('user_get@os4.com', 'user_get')
it 'should change unread if everything is okey ' do
it 'should change unread if everything is okay ' do
ticket = $database.getRow('ticket', 'Should we pay?', 'title')
result = request('/ticket/seen', {
ticketNumber: ticket['ticket_number'],