mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
update test and code format
This commit is contained in:
+2
-1
@@ -872,7 +872,8 @@ App::setResource('user', function ($mode, $project, $console, $request, $respons
|
||||
}
|
||||
}
|
||||
|
||||
$authJWT = $request->getParam('jwt', $request->getHeader('x-appwrite-jwt', ''));;
|
||||
$authJWT = $request->getParam('jwt', $request->getHeader('x-appwrite-jwt', ''));
|
||||
;
|
||||
|
||||
if (!empty($authJWT) && !$project->isEmpty()) { // JWT authentication
|
||||
$jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 900, 10); // Instantiate with key, algo, maxAge and leeway.
|
||||
|
||||
@@ -328,6 +328,15 @@ class AccountCustomClientTest extends Scope
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
|
||||
// JWT as request param
|
||||
$response = $this->client->call(Client::METHOD_GET, '/account?jwt=' . $jwt, array_merge([
|
||||
'origin' => 'http://localhost',
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]));
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
|
||||
$response = $this->client->call(Client::METHOD_DELETE, '/account/sessions/' . $sessionId, array_merge([
|
||||
'origin' => 'http://localhost',
|
||||
'content-type' => 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user