From c7e0659cfba8d20794e59a92ae1dd8e7bb67922f Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sat, 14 Oct 2023 14:35:31 +0200 Subject: [PATCH] [mastodon-client] Fix handling of long redirect URIs in the oauth_token table --- ...039-increase-oauth-token-redirecturis-length.ts | 14 ++++++++++++++ .../backend/src/models/entities/oauth-token.ts | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 packages/backend/src/migration/1697286869039-increase-oauth-token-redirecturis-length.ts diff --git a/packages/backend/src/migration/1697286869039-increase-oauth-token-redirecturis-length.ts b/packages/backend/src/migration/1697286869039-increase-oauth-token-redirecturis-length.ts new file mode 100644 index 000000000..e6fe1e7df --- /dev/null +++ b/packages/backend/src/migration/1697286869039-increase-oauth-token-redirecturis-length.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class IncreaseOauthTokenRedirecturisLength1697286869039 implements MigrationInterface { + name = 'IncreaseOauthTokenRedirecturisLength1697286869039' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "oauth_token" ALTER "redirectUri" TYPE character varying(512)`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "oauth_token" ALTER "redirectUri" TYPE character varying(64)`); + } + +} diff --git a/packages/backend/src/models/entities/oauth-token.ts b/packages/backend/src/models/entities/oauth-token.ts index 17d09c800..4e7bd3982 100644 --- a/packages/backend/src/models/entities/oauth-token.ts +++ b/packages/backend/src/models/entities/oauth-token.ts @@ -58,7 +58,7 @@ export class OAuthToken { public scopes: string[]; @Column("varchar", { - length: 64, + length: 512, comment: "The redirect URI of the OAuth token", }) public redirectUri: string;