mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Simplify PR
This commit is contained in:
parent
c69382f29f
commit
ca43281fa9
1 changed files with 1 additions and 5 deletions
|
|
@ -11,9 +11,6 @@ use Utopia\Database\DateTime;
|
||||||
use Utopia\Database\Document;
|
use Utopia\Database\Document;
|
||||||
use Utopia\System\System;
|
use Utopia\System\System;
|
||||||
|
|
||||||
/**
|
|
||||||
* @template T of Key
|
|
||||||
*/
|
|
||||||
class Key
|
class Key
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
|
@ -99,12 +96,11 @@ class Key
|
||||||
* Can be a stored API key or a dynamic key (JWT).
|
* Can be a stored API key or a dynamic key (JWT).
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
* @return T
|
|
||||||
*/
|
*/
|
||||||
public static function decode(
|
public static function decode(
|
||||||
Document $project,
|
Document $project,
|
||||||
string $key
|
string $key
|
||||||
) {
|
): Key {
|
||||||
if (\str_contains($key, '_')) {
|
if (\str_contains($key, '_')) {
|
||||||
[$type, $secret] = \explode('_', $key, 2);
|
[$type, $secret] = \explode('_', $key, 2);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue