-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.php
More file actions
78 lines (63 loc) · 1.69 KB
/
User.php
File metadata and controls
78 lines (63 loc) · 1.69 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/*
* Copyright (c) 2018 Adil Kachbat and contributors
* Copyright (c) 2023-2026 Gecka
*
* For the full copyright and license notice, please view the LICENSE
* file that was distributed with this source code.
*/
namespace SocialiteProviders\NcConnect;
use SocialiteProviders\Manager\OAuth2\User as BaseUser;
class User extends BaseUser
{
/**
* The user's id token hint (used for logout).
*/
public ?string $tokenId = null;
public function setTokenId(?string $tokenId): static
{
$this->tokenId = $tokenId;
return $this;
}
public function getPreferredUsername(): string
{
return $this->attributes['preferred_username'] ?? '';
}
public function getGivenName(): string
{
return $this->attributes['given_name'] ?? '';
}
public function getFirstName(): string
{
return $this->attributes['first_name'] ?? '';
}
public function getFamilyName(): string
{
return $this->attributes['family_name'] ?? '';
}
public function isEmailVerified(): bool
{
return (bool) ($this->attributes['email_verified'] ?? false);
}
/**
* Identity verification level.
*
* 0 = unverified, 1 = declarative, 2 = digitally verified.
*/
public function getVerifiedLevel(): int
{
return (int) ($this->attributes['verified'] ?? 0);
}
public function getBirthdate(): string
{
return $this->attributes['birthdate'] ?? '';
}
public function getGender(): string
{
return $this->attributes['gender'] ?? '';
}
public function getBirthplace(): string
{
return $this->attributes['birthplace'] ?? '';
}
}