@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.
- package/dist/generated/client/internal/class.js +2 -2
- package/dist/generated/client/internal/prismaNamespace.d.ts +2 -0
- package/dist/generated/client/internal/prismaNamespace.js +2 -0
- package/dist/generated/client/internal/prismaNamespaceBrowser.d.ts +2 -0
- package/dist/generated/client/internal/prismaNamespaceBrowser.js +2 -0
- package/dist/generated/client/models/RefreshToken.d.ts +56 -23
- package/package.json +2 -1
- package/prisma/migrations/20251228081517_create_initial_tables/migration.sql +707 -0
- package/prisma/migrations/20251228083337_refresh_token_hash/migration.sql +16 -0
- package/prisma/migrations/20251228084551/migration.sql +16 -0
- package/prisma/migrations/migration_lock.toml +3 -0
- package/prisma/schema.prisma +3 -1
|
@@ -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`);
|
package/prisma/schema.prisma
CHANGED
|
@@ -124,7 +124,9 @@ model Tenant {
|
|
|
124
124
|
|
|
125
125
|
model RefreshToken {
|
|
126
126
|
id String @id @default(cuid())
|
|
127
|
-
|
|
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
|