@valentine-efagene/qshelter-common 2.0.12 → 2.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,16 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - A unique constraint covering the columns `[tokenHash]` on the table `refresh_tokens` will be added. If there are existing duplicate values, this will fail.
5
+ - Added the required column `tokenHash` to the `refresh_tokens` table without a default value. This is not possible if the table is not empty.
6
+
7
+ */
8
+ -- DropIndex
9
+ DROP INDEX `refresh_tokens_token_key` ON `refresh_tokens`;
10
+
11
+ -- AlterTable
12
+ ALTER TABLE `refresh_tokens` ADD COLUMN `tokenHash` VARCHAR(64) NOT NULL,
13
+ MODIFY `token` LONGTEXT NULL;
14
+
15
+ -- CreateIndex
16
+ CREATE UNIQUE INDEX `refresh_tokens_tokenHash_key` ON `refresh_tokens`(`tokenHash`);
@@ -0,0 +1,16 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `tokenHash` on the `refresh_tokens` table. All the data in the column will be lost.
5
+ - A unique constraint covering the columns `[jti]` on the table `refresh_tokens` will be added. If there are existing duplicate values, this will fail.
6
+
7
+ */
8
+ -- DropIndex
9
+ DROP INDEX `refresh_tokens_tokenHash_key` ON `refresh_tokens`;
10
+
11
+ -- AlterTable
12
+ ALTER TABLE `refresh_tokens` DROP COLUMN `tokenHash`,
13
+ ADD COLUMN `jti` VARCHAR(255) NULL;
14
+
15
+ -- CreateIndex
16
+ CREATE UNIQUE INDEX `refresh_tokens_jti_key` ON `refresh_tokens`(`jti`);
@@ -0,0 +1,3 @@
1
+ # Please do not edit this file manually
2
+ # It should be added in your version-control system (e.g., Git)
3
+ provider = "mysql"
@@ -124,7 +124,9 @@ model Tenant {
124
124
 
125
125
  model RefreshToken {
126
126
  id String @id @default(cuid())
127
- token String @unique
127
+ // Use the JWT `jti` for indexed lookups and keep the raw JWT (optional)
128
+ jti String? @unique @db.VarChar(255)
129
+ token String? @db.LongText
128
130
  userId String
129
131
  user User @relation(fields: [userId], references: [id], onDelete: Cascade)
130
132
  expiresAt DateTime