mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-30 12:55:02 +00:00
Added api and components folders and installed headlessui
This commit is contained in:
parent
5f66cd8750
commit
c3346b9583
5 changed files with 54 additions and 1 deletions
16
package-lock.json
generated
16
package-lock.json
generated
|
|
@ -8,6 +8,7 @@
|
|||
"name": "assessment-model",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"@headlessui/react": "^1.7.14",
|
||||
"@types/node": "20.2.3",
|
||||
"@types/react": "18.2.7",
|
||||
"@types/react-dom": "18.2.4",
|
||||
|
|
@ -98,6 +99,21 @@
|
|||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@headlessui/react": {
|
||||
"version": "1.7.14",
|
||||
"resolved": "https://registry.npmjs.org/@headlessui/react/-/react-1.7.14.tgz",
|
||||
"integrity": "sha512-znzdq9PG8rkwcu9oQ2FwIy0ZFtP9Z7ycS+BAqJ3R5EIqC/0bJGvhT7193rFf+45i9nnPsYvCQVW4V/bB9Xc+gA==",
|
||||
"dependencies": {
|
||||
"client-only": "^0.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16 || ^17 || ^18",
|
||||
"react-dom": "^16 || ^17 || ^18"
|
||||
}
|
||||
},
|
||||
"node_modules/@humanwhocodes/config-array": {
|
||||
"version": "0.11.8",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz",
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@headlessui/react": "^1.7.14",
|
||||
"@types/node": "20.2.3",
|
||||
"@types/react": "18.2.7",
|
||||
"@types/react-dom": "18.2.4",
|
||||
|
|
|
|||
27
src/app/api/auth/[...nextauth]/route.ts
Normal file
27
src/app/api/auth/[...nextauth]/route.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import NextAuth, { NextAuthOptions } from "next-auth";
|
||||
import GoogleProvider from "next-auth/providers/google";
|
||||
|
||||
const { GOOGLE_CLIENT_ID = "", GOOGLE_CLIENT_SECRET = "" } = process.env;
|
||||
|
||||
export const AuthOptions: NextAuthOptions = {
|
||||
providers: [
|
||||
GoogleProvider({
|
||||
clientId: GOOGLE_CLIENT_ID,
|
||||
clientSecret: GOOGLE_CLIENT_SECRET,
|
||||
authorization: {
|
||||
params: {
|
||||
access_type: "offline",
|
||||
prompt: "consent",
|
||||
response_type: "code",
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
pages: {
|
||||
signIn: "/",
|
||||
},
|
||||
};
|
||||
|
||||
const handler = NextAuth(AuthOptions);
|
||||
|
||||
export { handler as GET, handler as POST };
|
||||
9
src/app/components/Provider.tsx
Normal file
9
src/app/components/Provider.tsx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
"use client";
|
||||
|
||||
import { SessionProvider } from "next-auth/react";
|
||||
|
||||
const Provider = ({ children }: { children: React.ReactNode }) => {
|
||||
return <SessionProvider>{children}</SessionProvider>;
|
||||
};
|
||||
|
||||
export default Provider;
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import "./globals.css";
|
||||
import Provider from "./components/Provider.tsx";
|
||||
import Provider from "./components/Provider";
|
||||
|
||||
export const metadata = {
|
||||
title: "",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue