Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/lobehub/lobe-chat
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 21, 2024
2 parents 752c7e1 + fc2e760 commit 738537f
Show file tree
Hide file tree
Showing 20 changed files with 812 additions and 190 deletions.
67 changes: 67 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,73 @@

# Changelog

### [Version 1.19.20](https://github.com/lobehub/lobe-chat/compare/v1.19.19...v1.19.20)

<sup>Released on **2024-09-21**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix Content-Security-Policy.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

- **misc**: Fix Content-Security-Policy, closes [#4056](https://github.com/lobehub/lobe-chat/issues/4056) ([d186062](https://github.com/lobehub/lobe-chat/commit/d186062))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 1.19.19](https://github.com/lobehub/lobe-chat/compare/v1.19.18...v1.19.19)

<sup>Released on **2024-09-21**</sup>

#### 🐛 Bug Fixes

- **misc**: Casdoor webhooks providerAccountId not found.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

- **misc**: Casdoor webhooks providerAccountId not found, closes [#4055](https://github.com/lobehub/lobe-chat/issues/4055) ([b832289](https://github.com/lobehub/lobe-chat/commit/b832289))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 1.19.18](https://github.com/lobehub/lobe-chat/compare/v1.19.17...v1.19.18)

<sup>Released on **2024-09-21**</sup>

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 1.19.17](https://github.com/lobehub/lobe-chat/compare/v1.19.16...v1.19.17)

<sup>Released on **2024-09-21**</sup>
Expand Down
34 changes: 33 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,42 @@ const nextConfig = {
source: '/sitemap.xml',
},
{
destination: '/discover',
destination: '/manifest.webmanifest',
permanent: true,
source: '/manifest.json',
},
{
destination: '/discover/assistant/:slug',
has: [
{
key: 'agent',
type: 'query',
value: '(?<slug>.*)',
},
],
permanent: true,
source: '/market',
},
{
destination: '/discover/assistants',
permanent: true,
source: '/discover/assistant',
},
{
destination: '/discover/models',
permanent: true,
source: '/discover/model',
},
{
destination: '/discover/plugins',
permanent: true,
source: '/discover/plugin',
},
{
destination: '/discover/providers',
permanent: true,
source: '/discover/provider',
},
{
destination: '/settings/common',
permanent: true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lobehub/chat",
"version": "1.19.17",
"version": "1.19.20",
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
"keywords": [
"framework",
Expand Down
166 changes: 0 additions & 166 deletions public/manifest.json

This file was deleted.

8 changes: 6 additions & 2 deletions src/app/(main)/discover/(detail)/_layout/Desktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ const Layout = ({ children }: PropsWithChildren) => {
align={'center'}
flex={1}
padding={24}
style={{ overflowX: 'hidden', overflowY: 'scroll', position: 'relative' }}
style={{ overflowX: 'hidden', overflowY: 'auto', position: 'relative' }}
width={'100%'}
>
<Flexbox gap={24} style={{ maxWidth: MAX_WIDTH, position: 'relative' }} width={'100%'}>
<Flexbox
gap={24}
style={{ maxWidth: MAX_WIDTH, minHeight: '100%', position: 'relative' }}
width={'100%'}
>
{children}
</Flexbox>
</Flexbox>
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/discover/(detail)/assistant/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const generateMetadata = async ({ params, searchParams }: Props) => {

const discoverService = new DiscoverService();
const data = await discoverService.getAssistantById(locale, identifier);
if (!data) return notFound();
if (!data) return;

const { meta, createdAt, homepage, author } = data;

Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/discover/(detail)/model/[...slugs]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const generateMetadata = async ({ params, searchParams }: Props) => {

const discoverService = new DiscoverService();
const data = await discoverService.getModelById(locale, identifier);
if (!data) return notFound();
if (!data) return;

const { meta, createdAt, providers } = data;

Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/discover/(detail)/plugin/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const generateMetadata = async ({ params, searchParams }: Props) => {

const discoverService = new DiscoverService();
const data = await discoverService.getPluginById(locale, identifier);
if (!data) return notFound();
if (!data) return;

const { meta, createdAt, homepage, author } = data;

Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/discover/(detail)/provider/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const generateMetadata = async ({ params, searchParams }: Props) => {

const discoverService = new DiscoverService();
const data = await discoverService.getProviderById(locale, identifier);
if (!data) return notFound();
if (!data) return;

const { meta, createdAt, models } = data;

Expand Down
16 changes: 11 additions & 5 deletions src/app/api/webhooks/casdoor/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@ export const POST = async (req: Request): Promise<NextResponse> => {
const nextAuthUserService = new NextAuthUserService();
switch (action) {
case 'update-user': {
return nextAuthUserService.safeUpdateUser(extendedUser.id, {
avatar: extendedUser?.avatar,
email: extendedUser?.email,
fullName: extendedUser.displayName,
});
return nextAuthUserService.safeUpdateUser(
{
provider: 'casdoor',
providerAccountId: extendedUser.id,
},
{
avatar: extendedUser?.avatar,
email: extendedUser?.email,
fullName: extendedUser.displayName,
},
);
}

default: {
Expand Down
16 changes: 11 additions & 5 deletions src/app/api/webhooks/logto/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@ export const POST = async (req: Request): Promise<NextResponse> => {
const nextAuthUserService = new NextAuthUserService();
switch (event) {
case 'User.Data.Updated': {
return nextAuthUserService.safeUpdateUser(data.id, {
avatar: data?.avatar,
email: data?.primaryEmail,
fullName: data?.name,
});
return nextAuthUserService.safeUpdateUser(
{
provider: 'logto',
providerAccountId: data.id,
},
{
avatar: data?.avatar,
email: data?.primaryEmail,
fullName: data?.name,
},
);
}

default: {
Expand Down
Loading

0 comments on commit 738537f

Please sign in to comment.