mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Merge pull request #1103 from TorstenDittmann/fix-anon-login-error
fix: improve error message on anon login
This commit is contained in:
commit
9dd754959d
1 changed files with 5 additions and 1 deletions
|
|
@ -611,10 +611,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);
|
||||
}
|
||||
|
||||
Authorization::disable();
|
||||
try {
|
||||
$user = $projectDB->createDocument([
|
||||
|
|
|
|||
Loading…
Reference in a new issue