mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
feat: bun api support 🥟 (#1021)
* chore: update bun lockfile * feat: backend api bun support, jose used in bun runtime * fix: add missing await for signPayload call
This commit is contained in:
parent
c0e2c58c03
commit
e7ca40b5ab
11 changed files with 128 additions and 29 deletions
|
|
@ -12,7 +12,7 @@ const { PORT, HOST, ALLOW_SOCIAL_LOGIN } = process.env ?? {};
|
|||
const port = Number(PORT) || 3080;
|
||||
const host = HOST || 'localhost';
|
||||
const projectPath = path.join(__dirname, '..', '..', 'client');
|
||||
const { jwtLogin, passportLogin } = require('../strategies');
|
||||
const { jwtLogin, joseLogin, passportLogin } = require('../strategies');
|
||||
|
||||
const startServer = async () => {
|
||||
await connectDb();
|
||||
|
|
@ -39,7 +39,11 @@ const startServer = async () => {
|
|||
|
||||
// OAUTH
|
||||
app.use(passport.initialize());
|
||||
passport.use(await jwtLogin());
|
||||
if (typeof Bun !== 'undefined') {
|
||||
passport.use('jwt', await joseLogin());
|
||||
} else {
|
||||
passport.use(await jwtLogin());
|
||||
}
|
||||
passport.use(passportLogin());
|
||||
|
||||
if (ALLOW_SOCIAL_LOGIN?.toLowerCase() === 'true') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue