mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
chore: rename to 'custom' sessions
This commit is contained in:
@@ -1111,10 +1111,10 @@ App::post('/v1/account/sessions/magic-url')
|
||||
;
|
||||
});
|
||||
|
||||
App::put('/v1/account/sessions/token')
|
||||
App::put('/v1/account/sessions/custom')
|
||||
->alias('/v1/account/sessions/magic-url')
|
||||
->alias('/v1/account/sessions/phone')
|
||||
->desc('Update token session')
|
||||
->desc('Update custom session')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'sessions')
|
||||
->label('auth.type', 'token')
|
||||
@@ -1125,7 +1125,7 @@ App::put('/v1/account/sessions/token')
|
||||
->label('sdk.auth', [])
|
||||
->label('sdk.namespace', 'account')
|
||||
->label('sdk.method', 'updateSessionToken')
|
||||
->label('sdk.description', '/docs/references/account/update-token-session.md')
|
||||
->label('sdk.description', '/docs/references/account/update-custom-session.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_SESSION)
|
||||
|
||||
@@ -1081,8 +1081,8 @@ App::patch('/v1/users/:userId/prefs')
|
||||
$response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES);
|
||||
});
|
||||
|
||||
App::post('/v1/users/:userId/tokens')
|
||||
->desc('Create session token')
|
||||
App::post('/v1/users/:userId/sessions')
|
||||
->desc('Create custom session')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].tokens.create')
|
||||
->label('scope', 'users.write')
|
||||
@@ -1091,8 +1091,8 @@ App::post('/v1/users/:userId/tokens')
|
||||
->label('usage.metric', 'tokens.requests.create')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'createSessionToken')
|
||||
->label('sdk.description', '/docs/references/users/create-session-token-session.md')
|
||||
->label('sdk.method', 'createCustomSession')
|
||||
->label('sdk.description', '/docs/references/users/create-custom-session.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_TOKEN)
|
||||
|
||||
@@ -2162,7 +2162,7 @@ class AccountCustomClientTest extends Scope
|
||||
*/
|
||||
public function testUpdateCustomSession(array $data): array
|
||||
{
|
||||
$response = $this->client->call(Client::METHOD_POST, '/users/' . $data['id'] . '/tokens', [
|
||||
$response = $this->client->call(Client::METHOD_POST, '/users/' . $data['id'] . '/sessions', [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey'],
|
||||
@@ -2176,7 +2176,7 @@ class AccountCustomClientTest extends Scope
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_PUT, '/account/sessions/token', [
|
||||
$response = $this->client->call(Client::METHOD_PUT, '/account/sessions/custom', [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], [
|
||||
@@ -2194,7 +2194,7 @@ class AccountCustomClientTest extends Scope
|
||||
* Test for FAILURE
|
||||
*/
|
||||
// Invalid userId
|
||||
$response = $this->client->call(Client::METHOD_PUT, '/account/sessions/token', [
|
||||
$response = $this->client->call(Client::METHOD_PUT, '/account/sessions/custom', [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], [
|
||||
@@ -2205,7 +2205,7 @@ class AccountCustomClientTest extends Scope
|
||||
$this->assertEquals(401, $response['headers']['status-code']);
|
||||
|
||||
// Invalid secret
|
||||
$response = $this->client->call(Client::METHOD_PUT, '/account/sessions/token', [
|
||||
$response = $this->client->call(Client::METHOD_PUT, '/account/sessions/custom', [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], [
|
||||
|
||||
@@ -237,7 +237,7 @@ trait UsersBase
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$token = $this->client->call(Client::METHOD_POST, '/users/' . $data['userId'] . '/tokens', array_merge([
|
||||
$token = $this->client->call(Client::METHOD_POST, '/users/' . $data['userId'] . '/sessions', array_merge([
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'expire' => 60,
|
||||
@@ -251,7 +251,7 @@ trait UsersBase
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
$token = $this->client->call(Client::METHOD_POST, '/users/invalid/tokens', array_merge([
|
||||
$token = $this->client->call(Client::METHOD_POST, '/users/invalid/sessions', array_merge([
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user