1
0
Fork 0
mirror of synced 2024-06-01 18:39:57 +12:00

Merge branch '0.8.x' into feat-auth-limits

This commit is contained in:
Eldad A. Fux 2021-04-23 09:34:16 +03:00 committed by GitHub
commit ba49f4d367
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -646,10 +646,14 @@ App::post('/v1/account/sessions/anonymous')
$protocol = $request->getProtocol();
if ($user->getId() || 'console' === $project->getId()) {
if ('console' === $project->getId()) {
throw new Exception('Failed to create anonymous user.', 401);
}
if ($user->getId()) {
throw new Exception('Cannot create an anonymous user when logged in.', 401);
}
$limit = $project->getAttribute('usersAuthLimit', 0);
if ($limit !== 0) {

View file

@ -283,6 +283,9 @@ class MySQL extends Adapter
if (\is_array($prop['value'])) {
throw new Exception('Value can\'t be an array: '.\json_encode($prop['value']));
}
if (\is_bool($prop['value'])) {
$prop['value'] = (int) $prop['value'];
}
$st2->bindValue(':documentUid', $data['$id'], PDO::PARAM_STR);
$st2->bindValue(':documentRevision', $revision, PDO::PARAM_STR);