Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/config/collections/common.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

use Utopia\Auth\Hashes\Argon2;
use Utopia\Database\Database;
use Utopia\Database\Helpers\ID;

Expand Down Expand Up @@ -173,7 +172,7 @@
'size' => 256,
'signed' => true,
'required' => false,
'default' => (new Argon2())->getName(),
'default' => 'argon2',
'array' => false,
'filters' => [],
],
Expand All @@ -184,7 +183,7 @@
'size' => 65535,
'signed' => true,
'required' => false,
'default' => (new Argon2())->getOptions(),
'default' => ['type' => 'argon2', 'memoryCost' => 2048, 'timeCost' => 4, 'threads' => 3],
'array' => false,
'filters' => ['json'],
],
Expand Down
12 changes: 6 additions & 6 deletions app/controllers/api/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,9 @@ function createUser(Hash $hash, string $userId, ?string $email, ?string $passwor
->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);

Expand Down Expand Up @@ -1379,9 +1379,9 @@ function createUser(Hash $hash, string $userId, ?string $email, ?string $passwor
// 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);

Expand Down
6 changes: 3 additions & 3 deletions app/init/resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -983,9 +983,9 @@ function getDevice(string $root, string $connection = ''): Device
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
Expand Down