Commit 0cf396ca authored by Victor Friboulet's avatar Victor Friboulet
Browse files

:fix: change the feature test according to the change in login and fix a...

:fix: change the feature test according to the change in login and fix a double quote probel in the hashing
parent aa59b41c
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -16,11 +16,7 @@ public function login(Request $request)

        $user = User::where('US_EMAIL', $request->mail)->first();

        /*if ($user == null || !$user->checkPassword(hash("sha256",$request->password))) {
            return view('login', ['wrongPassword' => true]);
        }*/

        if ($user == null || !$user->checkPassword($request->password)) {
        if ($user == null || !$user->checkPassword(hash('sha256',$request->password))) {
            return view('login', ['wrongPassword' => true]);
        }

+1 −2
Original line number Diff line number Diff line
@@ -687,8 +687,7 @@ class="flex items-center p-6 text-gray-500 bg-white rounded-lg shadow dark:text-
                                        role="alert" style="background-color: var(--badDarker);color: white;">
                                        <div class="ms-3 text-sm font-normal"><i
                                                class="fa-solid fa-triangle-exclamation"
                                                style="margin-right: 10px"></i> Attention, le mot de passe est
                                            incorrect !</div>
                                                style="margin-right: 10px"></i> Attention, le mot de passe est incorrect !</div>
                                        <button type="button"
                                            style="background-color: var(--badDarker);color: white;"
                                            class="ms-auto -mx-1.5 -my-1.5 bg-white text-gray-400 hover:text-gray-900 rounded-lg focus:ring-2 focus:ring-gray-300 p-1.5 hover:bg-gray-100 inline-flex items-center justify-center h-8 w-8 dark:text-gray-500 dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700"
+1 −1
Original line number Diff line number Diff line
@@ -49,6 +49,6 @@ public function test_wrong_login_view()
    {
        $response = $this->followingRedirects()->post('/login',['mail'=>'wrong@email.com','password'=>'wrongpassword']);

        $response->assertSee('Wrong password !');
        $response->assertSee('Attention, le mot de passe est incorrect !');
    }
}