mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-27 13:29:15 +07:00
🔨 chore: add OAuth 2.0 and OIDC core implement (#7380)
* add oidc implement * add oidc implement * update * update * migration db * improve * improve scripts * update * 解决 auth 302 跳转的问题 * 完成 policy 实现调试 * improve middleware log * 初步完成 auth 授权实现 * 初步完成 auth 授权实现 * fix adapter * add adapter tests * refactor with http adapter * refactor for oidc service * finish oauth 授权基础实现 * 区分 backend 入口与 client 页面入口 * add i18n * update db schema * fix lint * improve * fix tests and update i18n * improve db adaptor * fix tests * fix tests * fix tests
This commit is contained in:
@@ -3,7 +3,6 @@ import { migrate as neonMigrate } from 'drizzle-orm/neon-serverless/migrator';
|
||||
import { migrate as nodeMigrate } from 'drizzle-orm/node-postgres/migrator';
|
||||
import { join } from 'node:path';
|
||||
|
||||
import { serverDB } from '../../src/database/server';
|
||||
import { DB_FAIL_INIT_HINT, PGVECTOR_HINT } from './errorHint';
|
||||
|
||||
// Read the `.env` file if it exists, or a file specified by the
|
||||
@@ -13,7 +12,10 @@ dotenv.config();
|
||||
const migrationsFolder = join(__dirname, '../../src/database/migrations');
|
||||
|
||||
const isDesktop = process.env.NEXT_PUBLIC_IS_DESKTOP_APP === '1';
|
||||
|
||||
const runMigrations = async () => {
|
||||
const { serverDB } = await import('../../src/database/server');
|
||||
|
||||
if (process.env.DATABASE_DRIVER === 'node') {
|
||||
await nodeMigrate(serverDB, { migrationsFolder });
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user