Force auth
This commit is contained in:
parent
1cc1beb63e
commit
c8aefcab04
5 changed files with 26 additions and 9 deletions
|
|
@ -19,6 +19,7 @@ import {
|
|||
import { useState } from 'react'
|
||||
import { Button } from './ui/button'
|
||||
import { Input } from './ui/input'
|
||||
import { toast } from 'react-hot-toast'
|
||||
|
||||
const IS_PREVIEW = process.env.VERCEL_ENV === 'preview'
|
||||
export interface ChatProps extends React.ComponentProps<'div'> {
|
||||
|
|
@ -40,6 +41,11 @@ export function Chat({ id, initialMessages, className }: ChatProps) {
|
|||
body: {
|
||||
id,
|
||||
previewToken
|
||||
},
|
||||
onResponse(response) {
|
||||
if (response.status === 401) {
|
||||
toast.error(response.statusText)
|
||||
}
|
||||
}
|
||||
})
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue