-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathSessionAuthenticationFailureResponse.php
More file actions
43 lines (38 loc) · 1.08 KB
/
SessionAuthenticationFailureResponse.php
File metadata and controls
43 lines (38 loc) · 1.08 KB
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
43
<?php
namespace WorkOS\Resource;
/**
* Class SessionAuthenticationFailureResponse.
*
* Represents a failed session authentication.
*
* @property bool $authenticated
* @property string $reason
*/
class SessionAuthenticationFailureResponse extends BaseWorkOSResource
{
public const REASON_NO_SESSION_COOKIE_PROVIDED = "NO_SESSION_COOKIE_PROVIDED";
public const REASON_INVALID_SESSION_COOKIE = "INVALID_SESSION_COOKIE";
public const REASON_ENCRYPTION_ERROR = "ENCRYPTION_ERROR";
public const REASON_HTTP_ERROR = "HTTP_ERROR";
public const RESOURCE_ATTRIBUTES = [
"authenticated",
"reason"
];
public const RESPONSE_TO_RESOURCE_KEY = [
"authenticated" => "authenticated",
"reason" => "reason"
];
/**
* Construct a failure response with a specific reason.
*
* @param string $reason Reason for authentication failure
*/
public function __construct(string $reason)
{
$this->values = [
"authenticated" => false,
"reason" => $reason
];
$this->raw = [];
}
}