mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-06-30 16:40:05 +08:00
clean up changes
This commit is contained in:
@@ -4,5 +4,5 @@ export { default } from "next-auth/middleware";
|
||||
* Guards all pages under `/grading` and redirects them to the sign in page.
|
||||
*/
|
||||
export const config = {
|
||||
matcher: ["/create/:path*", "/evaluate/:path*", "/grading/:path*", "/account/:path*", "/summarize/:path*"],
|
||||
matcher: ["/create/:path*", "/evaluate/:path*", "/account/:path*"],
|
||||
};
|
||||
|
||||
@@ -11,11 +11,9 @@ export default function Error() {
|
||||
<title>404 - Open Assistant</title>
|
||||
<meta name="404" content="Sorry, this page doesn't exist." />
|
||||
</Head>
|
||||
<Header />
|
||||
<main className="flex h-3/4 items-center justify-center overflow-hidden subpixel-antialiased text-xl">
|
||||
<p>Sorry, the page you are looking for does not exist.</p>
|
||||
</main>
|
||||
<Footer />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ function MyApp({ Component, pageProps: { session, ...pageProps } }: AppPropsWith
|
||||
|
||||
return (
|
||||
<ChakraProvider theme={theme}>
|
||||
<SessionProvider session={pageProps.session}>{page}</SessionProvider>
|
||||
<SessionProvider session={session}>{page}</SessionProvider>
|
||||
</ChakraProvider>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
import React, { useState } from "react";
|
||||
import { getSession, useSession } from "next-auth/react";
|
||||
import { PrismaClient, User } from "@prisma/client";
|
||||
import { useSession } from "next-auth/react";
|
||||
import { Button, Input, InputGroup, Stack } from "@chakra-ui/react";
|
||||
import Head from "next/head";
|
||||
import Link from "next/link";
|
||||
import Router from "next/router";
|
||||
import { Footer } from "src/components/Footer";
|
||||
import { Header } from "src/components/Header";
|
||||
|
||||
import styles from "../styles/Home.module.css";
|
||||
|
||||
export default function Account() {
|
||||
const { data: session } = useSession();
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
import Head from "next/head";
|
||||
import Link from "next/link";
|
||||
import Router from "next/router";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { getSession, useSession } from "next-auth/react";
|
||||
import { Button, Input, InputGroup, Stack } from "@chakra-ui/react";
|
||||
import { Footer } from "../../components/Footer";
|
||||
import { Header } from "../../components/Header";
|
||||
|
||||
import styles from "../styles/Home.module.css";
|
||||
import { getSystemErrorName } from "util";
|
||||
import React, { useState } from "react";
|
||||
import { useSession } from "next-auth/react";
|
||||
import { Button } from "@chakra-ui/react";
|
||||
|
||||
export default function Account() {
|
||||
const { data: session } = useSession();
|
||||
|
||||
@@ -12,7 +12,7 @@ export default async function handle(req, res) {
|
||||
const session = await getSession({ req });
|
||||
const result = await prisma.user.update({
|
||||
where: {
|
||||
email: session?.user?.email,
|
||||
email: session.user.email,
|
||||
},
|
||||
data: {
|
||||
name: username,
|
||||
|
||||
Reference in New Issue
Block a user