Skip to content

Commit 9bb2c6c

Browse files
committed
chore: add new IResourceContextMethods
* getCurrentUserFirstName * getCurrentUserLastName
1 parent 59d1ae9 commit 9bb2c6c

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

app/Models/OAuth2/IResourceServerContext.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,14 @@ public function updateAuthContextVar(string $varName, $value):void;
107107
*/
108108
public function getCurrentUserEmail():?string;
109109

110-
}
110+
/**
111+
* @return string|null
112+
*/
113+
public function getCurrentUserFirstName():?string;
114+
115+
/**
116+
* @return string|null
117+
*/
118+
public function getCurrentUserLastName():?string;
119+
120+
}

app/Models/OAuth2/ResourceServerContext.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,4 +312,14 @@ public function getCurrentUserEmail(): ?string
312312
{
313313
return $this->getAuthContextVar(IResourceServerContext::UserEmail);
314314
}
315+
316+
public function getCurrentUserFirstName(): ?string
317+
{
318+
return $this->getAuthContextVar(IResourceServerContext::UserFirstName);
319+
}
320+
321+
public function getCurrentUserLastName(): ?string
322+
{
323+
return $this->getAuthContextVar(IResourceServerContext::UserLastName);
324+
}
315325
}

0 commit comments

Comments
 (0)