Skip to content

Commit

Permalink
fixed readme and some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosdipaoloSV committed Jan 11, 2021
1 parent e4f050c commit c571c6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
## A basic PHP Authentication Package
###
The `Auth` constructor receives as a unique argument a `PDO` instance connected to your app's database.
This connection is necessary to check credentials and register users.
The rest of the operations can be performed without passing anything, like logging in or logging out a user, checking if there's a user logged in, or getting the logged user.
This connection is necessary to check credentials and register users. The rest of the operations can be performed without passing anything, like logging in or logging out a user, checking if there's a user logged in, or getting the logged user.

The login and logout method just puts or remove the user in the `user` session's key. In order to do so `Auth` makes use of the `marcosdipaolo/session` package.

Expand Down
4 changes: 2 additions & 2 deletions src/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public function user(): Authenticatable

public function login(Authenticatable $user): bool
{
session()->put('user', $user);
return session()->put('user', $user);
}

public function logout(): bool
{
session()->forget('user');
return session()->forget('user');
}

public function isUserLoggedIn(): bool
Expand Down

0 comments on commit c571c6b

Please sign in to comment.