Skip to content

Conversation

sammyskills
Copy link
Contributor

Add a method to get the previous login record of a user, useful for displaying to the user, the last time the account was accessed.

@kenjis
Copy link
Member

kenjis commented Jul 17, 2022

Can you add test code?

@kenjis kenjis added the enhancement New feature or request label Jul 17, 2022
@kenjis
Copy link
Member

kenjis commented Jul 18, 2022

You have a coding style violation.
Please run composer cs-fix to fix it.

   1) shield/tests/Unit/UserTest.php (no_whitespace_in_blank_line)
      ---------- begin diff ----------
--- /home/runner/work/shield/shield/tests/Unit/UserTest.php
+++ /home/runner/work/shield/shield/tests/Unit/UserTest.php
@@ -111,7 +111,7 @@
         // No logins found.
         $this->assertNull($this->user->previousLogin());
-        
+
         fake(
             LoginModel::class,
             ['id_type' => 'email', 'identifier' => $this->user->email, 'user_id' => $this->user->id]
      ----------- end diff -----------

@sammyskills sammyskills requested review from kenjis and MGatner July 24, 2022 07:53
Copy link
Member

@kenjis kenjis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kenjis kenjis merged commit 121ac4a into codeigniter4:develop Jul 24, 2022
@sammyskills sammyskills deleted the add-previous-login-method branch July 24, 2022 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants