mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +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
|
<?php
|
||||||
|
|
||||||
use Utopia\Auth\Hashes\Argon2;
|
|
||||||
use Utopia\Database\Database;
|
use Utopia\Database\Database;
|
||||||
use Utopia\Database\Helpers\ID;
|
use Utopia\Database\Helpers\ID;
|
||||||
|
|
||||||
|
|
@ -173,7 +172,7 @@ return [
|
||||||
'size' => 256,
|
'size' => 256,
|
||||||
'signed' => true,
|
'signed' => true,
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'default' => (new Argon2())->getName(),
|
'default' => 'argon2',
|
||||||
'array' => false,
|
'array' => false,
|
||||||
'filters' => [],
|
'filters' => [],
|
||||||
],
|
],
|
||||||
|
|
@ -184,7 +183,7 @@ return [
|
||||||
'size' => 65535,
|
'size' => 65535,
|
||||||
'signed' => true,
|
'signed' => true,
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'default' => (new Argon2())->getOptions(),
|
'default' => ['type' => 'argon2', 'memoryCost' => 2048, 'timeCost' => 4, 'threads' => 3],
|
||||||
'array' => false,
|
'array' => false,
|
||||||
'filters' => ['json'],
|
'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) {
|
->action(function (string $userId, string $email, string $password, string $name, Response $response, Document $project, Database $dbForProject, Hooks $hooks) {
|
||||||
$argon2 = new Argon2();
|
$argon2 = new Argon2();
|
||||||
$argon2
|
$argon2
|
||||||
->setMemoryCost(7168)
|
->setMemoryCost(2048)
|
||||||
->setTimeCost(5)
|
->setTimeCost(4)
|
||||||
->setThreads(1);
|
->setThreads(3);
|
||||||
|
|
||||||
$user = createUser($argon2, $userId, $email, $password, null, $name, $project, $dbForProject, $hooks);
|
$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
|
// Create Argon2 hasher with default settings
|
||||||
$hasher = new Argon2();
|
$hasher = new Argon2();
|
||||||
$hasher
|
$hasher
|
||||||
->setMemoryCost(7168)
|
->setMemoryCost(2048)
|
||||||
->setTimeCost(5)
|
->setTimeCost(4)
|
||||||
->setThreads(1);
|
->setThreads(3);
|
||||||
|
|
||||||
$newPassword = $hasher->hash($password);
|
$newPassword = $hasher->hash($password);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -983,9 +983,9 @@ App::setResource('store', function (): Store {
|
||||||
App::setResource('proofForPassword', function (): Password {
|
App::setResource('proofForPassword', function (): Password {
|
||||||
$hash = new Argon2();
|
$hash = new Argon2();
|
||||||
$hash
|
$hash
|
||||||
->setMemoryCost(7168)
|
->setMemoryCost(2048)
|
||||||
->setTimeCost(5)
|
->setTimeCost(4)
|
||||||
->setThreads(1);
|
->setThreads(3);
|
||||||
|
|
||||||
$password = new Password();
|
$password = new Password();
|
||||||
$password
|
$password
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue