From ffa09d81e24795988dd0038b065c20178ee3ee2d Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 3 Feb 2018 12:18:18 -0600 Subject: [PATCH] Pass strings for deletion of user sessions, closes #906 --- CHANGELOG.md | 6 +++++- app/Contracts/Repository/SessionRepositoryInterface.php | 6 +++--- app/Http/Controllers/Base/SecurityController.php | 4 ++-- app/Repositories/Eloquent/SessionRepository.php | 6 +++--- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e377af77e..1f0e62f2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,11 @@ This file is a running track of new features and fixes to each version of the pa This project follows [Semantic Versioning](http://semver.org) guidelines. -### v0.7.0-rc.1 (Derelict Dermodactylus) +## v0.7.0-rc.2 (Derelict Dermodactylus) +### Fixed +* `[rc.1]` — Fixes exception thrown when revoking user sessions. + +## v0.7.0-rc.1 (Derelict Dermodactylus) ### Fixed * `[beta.4]` — Fixes some bad search and replace action that happened previously and was throwing errors when validating user permissions. * `[beta.4]` — Fixes behavior of variable validation to not break the page when no rules are provided. diff --git a/app/Contracts/Repository/SessionRepositoryInterface.php b/app/Contracts/Repository/SessionRepositoryInterface.php index 1f2dd73e8..8020d15a3 100644 --- a/app/Contracts/Repository/SessionRepositoryInterface.php +++ b/app/Contracts/Repository/SessionRepositoryInterface.php @@ -17,9 +17,9 @@ interface SessionRepositoryInterface extends RepositoryInterface /** * Delete a session for a given user. * - * @param int $user - * @param int $session + * @param int $user + * @param string $session * @return null|int */ - public function deleteUserSession(int $user, int $session); + public function deleteUserSession(int $user, string $session); } diff --git a/app/Http/Controllers/Base/SecurityController.php b/app/Http/Controllers/Base/SecurityController.php index 8a7babecb..61c45d743 100644 --- a/app/Http/Controllers/Base/SecurityController.php +++ b/app/Http/Controllers/Base/SecurityController.php @@ -139,10 +139,10 @@ class SecurityController extends Controller * Revokes a user session. * * @param \Illuminate\Http\Request $request - * @param int $id + * @param string $id * @return \Illuminate\Http\RedirectResponse */ - public function revoke(Request $request, $id) + public function revoke(Request $request, string $id) { $this->repository->deleteUserSession($request->user()->id, $id); diff --git a/app/Repositories/Eloquent/SessionRepository.php b/app/Repositories/Eloquent/SessionRepository.php index 47d955077..a49226452 100644 --- a/app/Repositories/Eloquent/SessionRepository.php +++ b/app/Repositories/Eloquent/SessionRepository.php @@ -32,11 +32,11 @@ class SessionRepository extends EloquentRepository implements SessionRepositoryI /** * Delete a session for a given user. * - * @param int $user - * @param int $session + * @param int $user + * @param string $session * @return null|int */ - public function deleteUserSession(int $user, int $session) + public function deleteUserSession(int $user, string $session) { return $this->getBuilder()->where('user_id', $user)->where('id', $session)->delete(); }