Pass strings for deletion of user sessions, closes #906
This commit is contained in:
parent
47f1c9c4ec
commit
ffa09d81e2
4 changed files with 13 additions and 9 deletions
|
@ -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.
|
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
|
### Fixed
|
||||||
* `[beta.4]` — Fixes some bad search and replace action that happened previously and was throwing errors when validating user permissions.
|
* `[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.
|
* `[beta.4]` — Fixes behavior of variable validation to not break the page when no rules are provided.
|
||||||
|
|
|
@ -17,9 +17,9 @@ interface SessionRepositoryInterface extends RepositoryInterface
|
||||||
/**
|
/**
|
||||||
* Delete a session for a given user.
|
* Delete a session for a given user.
|
||||||
*
|
*
|
||||||
* @param int $user
|
* @param int $user
|
||||||
* @param int $session
|
* @param string $session
|
||||||
* @return null|int
|
* @return null|int
|
||||||
*/
|
*/
|
||||||
public function deleteUserSession(int $user, int $session);
|
public function deleteUserSession(int $user, string $session);
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,10 +139,10 @@ class SecurityController extends Controller
|
||||||
* Revokes a user session.
|
* Revokes a user session.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param int $id
|
* @param string $id
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function revoke(Request $request, $id)
|
public function revoke(Request $request, string $id)
|
||||||
{
|
{
|
||||||
$this->repository->deleteUserSession($request->user()->id, $id);
|
$this->repository->deleteUserSession($request->user()->id, $id);
|
||||||
|
|
||||||
|
|
|
@ -32,11 +32,11 @@ class SessionRepository extends EloquentRepository implements SessionRepositoryI
|
||||||
/**
|
/**
|
||||||
* Delete a session for a given user.
|
* Delete a session for a given user.
|
||||||
*
|
*
|
||||||
* @param int $user
|
* @param int $user
|
||||||
* @param int $session
|
* @param string $session
|
||||||
* @return null|int
|
* @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();
|
return $this->getBuilder()->where('user_id', $user)->where('id', $session)->delete();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue