mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
fix!: do not allow insecure oauth requests by default (#27844)
* fix!: do not allow insecure oauth requests by default * fix: format * fix: make open-api * fix: tests * nit: casing * chore: migration to allow insecure if current oauth uses http
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { Kysely, sql } from 'kysely';
|
||||
|
||||
export async function up(db: Kysely<any>): Promise<void> {
|
||||
await sql`
|
||||
UPDATE system_metadata
|
||||
SET value = jsonb_set(
|
||||
value,
|
||||
'{oauth,allowInsecureRequests}',
|
||||
'true'::jsonb
|
||||
)
|
||||
WHERE key = 'system-config'
|
||||
AND value->'oauth'->>'issuerUrl' LIKE 'http://%'
|
||||
`.execute(db);
|
||||
}
|
||||
|
||||
export async function down(db: Kysely<any>): Promise<void> {
|
||||
await sql`
|
||||
UPDATE system_metadata
|
||||
SET value = value #- '{oauth,allowInsecureRequests}'
|
||||
WHERE key = 'system-config'
|
||||
`.execute(db);
|
||||
}
|
||||
Reference in New Issue
Block a user