mirror of
https://github.com/appwrite/appwrite
synced 2026-05-20 07:28:33 +00:00
Merge pull request #10667 from appwrite/fix-auth-refactor
Fix: reset argon 2 options to previous default
This commit is contained in:
commit
254f026458
3 changed files with 11 additions and 12 deletions
|
|
@ -1,6 +1,5 @@
|
|||
<?php
|
||||
|
||||
use Utopia\Auth\Hashes\Argon2;
|
||||
use Utopia\Database\Database;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
|
||||
|
|
@ -173,7 +172,7 @@ return [
|
|||
'size' => 256,
|
||||
'signed' => true,
|
||||
'required' => false,
|
||||
'default' => (new Argon2())->getName(),
|
||||
'default' => 'argon2',
|
||||
'array' => false,
|
||||
'filters' => [],
|
||||
],
|
||||
|
|
@ -184,7 +183,7 @@ return [
|
|||
'size' => 65535,
|
||||
'signed' => true,
|
||||
'required' => false,
|
||||
'default' => (new Argon2())->getOptions(),
|
||||
'default' => ['type' => 'argon2', 'memoryCost' => 2048, 'timeCost' => 4, 'threads' => 3],
|
||||
'array' => false,
|
||||
'filters' => ['json'],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -351,9 +351,9 @@ App::post('/v1/users/argon2')
|
|||
->action(function (string $userId, string $email, string $password, string $name, Response $response, Document $project, Database $dbForProject, Hooks $hooks) {
|
||||
$argon2 = new Argon2();
|
||||
$argon2
|
||||
->setMemoryCost(7168)
|
||||
->setTimeCost(5)
|
||||
->setThreads(1);
|
||||
->setMemoryCost(2048)
|
||||
->setTimeCost(4)
|
||||
->setThreads(3);
|
||||
|
||||
$user = createUser($argon2, $userId, $email, $password, null, $name, $project, $dbForProject, $hooks);
|
||||
|
||||
|
|
@ -1379,9 +1379,9 @@ App::patch('/v1/users/:userId/password')
|
|||
// Create Argon2 hasher with default settings
|
||||
$hasher = new Argon2();
|
||||
$hasher
|
||||
->setMemoryCost(7168)
|
||||
->setTimeCost(5)
|
||||
->setThreads(1);
|
||||
->setMemoryCost(2048)
|
||||
->setTimeCost(4)
|
||||
->setThreads(3);
|
||||
|
||||
$newPassword = $hasher->hash($password);
|
||||
|
||||
|
|
|
|||
|
|
@ -983,9 +983,9 @@ App::setResource('store', function (): Store {
|
|||
App::setResource('proofForPassword', function (): Password {
|
||||
$hash = new Argon2();
|
||||
$hash
|
||||
->setMemoryCost(7168)
|
||||
->setTimeCost(5)
|
||||
->setThreads(1);
|
||||
->setMemoryCost(2048)
|
||||
->setTimeCost(4)
|
||||
->setThreads(3);
|
||||
|
||||
$password = new Password();
|
||||
$password
|
||||
|
|
|
|||
Loading…
Reference in a new issue