-
-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathUserStorage.php
More file actions
42 lines (33 loc) · 995 Bytes
/
UserStorage.php
File metadata and controls
42 lines (33 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php declare(strict_types=1);
/**
* This file is part of the Nette Framework (https://nette.org)
* Copyright (c) 2004 David Grudl (https://davidgrudl.com)
*/
namespace Nette\Security;
/**
* Persistent storage for user authentication state and identity.
*/
interface UserStorage
{
/** @deprecated use User::LogoutManual */
public const LOGOUT_MANUAL = 1;
/** @deprecated use User::LogoutInactivity */
public const LOGOUT_INACTIVITY = 2;
/**
* Saves authenticated identity to storage.
*/
function saveAuthentication(IIdentity $identity): void;
/**
* Removes authenticated state from storage.
*/
function clearAuthentication(bool $clearIdentity): void;
/**
* Returns user authenticated state, identity and logout reason.
* @return array{bool, ?IIdentity, ?int}
*/
function getState(): array;
/**
* Enables log out from the persistent storage after inactivity (like '20 minutes').
*/
function setExpiration(?string $expire, bool $clearIdentity): void;
}