Ignore:
Timestamp:
08/26/24 16:17:04 (4 months ago)
Author:
bube-ristovska <ristovska725@…>
Branches:
main
Parents:
5372778
Message:

Refactored duplicate code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • app/Http/Controllers/SessionsController.php

    r5372778 r3c89e27  
    2424            'password' => 'required'
    2525        ]);
     26
    2627        $password = $credentials['password'];
    2728        $badge_no = $credentials['badge_no'];
     29        if (!is_numeric($badge_no)) {
     30            // Redirect back with an error message
     31            return back()->withErrors(['password' => 'Invalid credentials']);
     32        }
    2833        // mozhe da se najavi kako policaec i kako officer, znaeme koj e koj po znachkata
    2934
     
    6974        return back()->withErrors(['password' => 'Invalid credentials']);
    7075    }
    71 
    7276    public function logout()
    7377    {
Note: See TracChangeset for help on using the changeset viewer.