1
0
Fork 0
mirror of synced 2024-06-01 10:29:48 +12:00

Changed JWT expiry to max 15 minutes

This commit is contained in:
Eldad Fux 2020-12-28 23:23:09 +02:00
parent e4e0c23968
commit bb52478bc3
2 changed files with 3 additions and 3 deletions

View file

@ -667,7 +667,7 @@ App::post('/v1/account/jwt')
throw new Exception('No valid session found', 401);
}
$jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 3600, 10); // Instantiate with key, algo, maxAge and leeway.
$jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 900, 10); // Instantiate with key, algo, maxAge and leeway.
$response
->setStatusCode(Response::STATUS_CODE_CREATED)

View file

@ -405,8 +405,8 @@ App::setResource('user', function($mode, $project, $console, $request, $response
$authJWT = $request->getHeader('x-appwrite-jwt', '');
if (!empty($authJWT)) { // JWT authentication
$jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 3600, 10); // Instantiate with key, algo, maxAge and leeway.
$jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 900, 10); // Instantiate with key, algo, maxAge and leeway.
try {
$payload = $jwt->decode($authJWT);
} catch (JWTException $error) {