drop custom id support on sessions
This commit is contained in:
parent
fc92b3f294
commit
bcce7bc88e
|
@ -139,7 +139,6 @@ App::post('/v1/account/sessions')
|
|||
->label('sdk.response.model', Response::MODEL_SESSION)
|
||||
->label('abuse-limit', 10)
|
||||
->label('abuse-key', 'url:{url},email:{param-email}')
|
||||
->param('sessionId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, and underscore. Can\'t start with a leading underscore. Max length is 36 chars.')
|
||||
->param('email', '', new Email(), 'User email.')
|
||||
->param('password', '', new Password(), 'User password. Must be between 6 to 32 chars.')
|
||||
->inject('request')
|
||||
|
@ -148,7 +147,7 @@ App::post('/v1/account/sessions')
|
|||
->inject('locale')
|
||||
->inject('geodb')
|
||||
->inject('audits')
|
||||
->action(function ($sessionId, $email, $password, $request, $response, $dbForInternal, $locale, $geodb, $audits) {
|
||||
->action(function ($email, $password, $request, $response, $dbForInternal, $locale, $geodb, $audits) {
|
||||
/** @var Utopia\Swoole\Request $request */
|
||||
/** @var Appwrite\Utopia\Response $response */
|
||||
/** @var Utopia\Database\Database $dbForInternal */
|
||||
|
@ -181,7 +180,7 @@ App::post('/v1/account/sessions')
|
|||
$secret = Auth::tokenGenerator();
|
||||
$session = new Document(array_merge(
|
||||
[
|
||||
'$id' => $sessionId == 'unique()' ? $dbForInternal->getId() : $sessionId,
|
||||
'$id' => $dbForInternal->getId(),
|
||||
'userId' => $profile->getId(),
|
||||
'provider' => Auth::SESSION_PROVIDER_EMAIL,
|
||||
'providerUid' => $email,
|
||||
|
|
|
@ -34,8 +34,6 @@ $root = ($this->getParam('root') !== 'disabled');
|
|||
data-failure="alert"
|
||||
data-failure-param-alert-text="Login failed. Please check your credentials."
|
||||
data-failure-param-alert-classname="error">
|
||||
|
||||
<input name="sessionId" type="hidden" value="unique()">
|
||||
|
||||
<input name="email" type="email" class="full-width" autocomplete="email" placeholder="Email" required>
|
||||
|
||||
|
|
|
@ -100,7 +100,6 @@ abstract class Scope extends TestCase
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => 'console',
|
||||
], [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email,
|
||||
'password' => $password,
|
||||
]);
|
||||
|
@ -153,7 +152,6 @@ abstract class Scope extends TestCase
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email,
|
||||
'password' => $password,
|
||||
]);
|
||||
|
|
|
@ -111,7 +111,6 @@ trait AccountBase
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email,
|
||||
'password' => $password,
|
||||
]);
|
||||
|
@ -129,7 +128,6 @@ trait AccountBase
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email.'x',
|
||||
'password' => $password,
|
||||
]);
|
||||
|
@ -141,7 +139,6 @@ trait AccountBase
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email,
|
||||
'password' => $password.'x',
|
||||
]);
|
||||
|
@ -153,7 +150,6 @@ trait AccountBase
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => '',
|
||||
'password' => '',
|
||||
]);
|
||||
|
@ -491,7 +487,6 @@ trait AccountBase
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email,
|
||||
'password' => 'new-password',
|
||||
]);
|
||||
|
@ -855,7 +850,6 @@ trait AccountBase
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email,
|
||||
'password' => $password,
|
||||
]);
|
||||
|
@ -923,7 +917,6 @@ trait AccountBase
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email,
|
||||
'password' => $password,
|
||||
]);
|
||||
|
@ -1006,7 +999,6 @@ trait AccountBase
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email,
|
||||
'password' => $password,
|
||||
]);
|
||||
|
|
|
@ -83,7 +83,6 @@ class AccountCustomClientTest extends Scope
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email,
|
||||
'password' => $password,
|
||||
]);
|
||||
|
@ -126,7 +125,6 @@ class AccountCustomClientTest extends Scope
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email,
|
||||
'password' => $password,
|
||||
]);
|
||||
|
@ -165,7 +163,6 @@ class AccountCustomClientTest extends Scope
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email,
|
||||
'password' => $password,
|
||||
]);
|
||||
|
@ -374,7 +371,6 @@ class AccountCustomClientTest extends Scope
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email,
|
||||
'password' => $password,
|
||||
]);
|
||||
|
|
|
@ -331,7 +331,6 @@ class ProjectsConsoleClientTest extends Scope
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $id,
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $originalEmail,
|
||||
'password' => $originalPassword,
|
||||
]);
|
||||
|
@ -421,7 +420,6 @@ class ProjectsConsoleClientTest extends Scope
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $id,
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $originalEmail,
|
||||
'password' => $originalPassword,
|
||||
]);
|
||||
|
|
|
@ -89,7 +89,6 @@ class WebhooksCustomClientTest extends Scope
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email,
|
||||
'password' => $password,
|
||||
]);
|
||||
|
@ -146,7 +145,6 @@ class WebhooksCustomClientTest extends Scope
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email,
|
||||
'password' => $password,
|
||||
]);
|
||||
|
@ -213,7 +211,6 @@ class WebhooksCustomClientTest extends Scope
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email,
|
||||
'password' => $password,
|
||||
]);
|
||||
|
@ -286,7 +283,6 @@ class WebhooksCustomClientTest extends Scope
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email,
|
||||
'password' => $password,
|
||||
]);
|
||||
|
@ -345,7 +341,6 @@ class WebhooksCustomClientTest extends Scope
|
|||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
]), [
|
||||
'sessionId' => 'unique()',
|
||||
'email' => $email,
|
||||
'password' => $password,
|
||||
]);
|
||||
|
|
Loading…
Reference in a new issue