look ma i'm nexting
This commit is contained in:
		
							parent
							
								
									d369880579
								
							
						
					
					
						commit
						6591e0987f
					
				
					 8 changed files with 161 additions and 1463 deletions
				
			
		|  | @ -1,7 +1,12 @@ | |||
| import '../styles/globals.css' | ||||
| import "../styles/globals.css"; | ||||
| import { SessionProvider } from "next-auth/react"; | ||||
| 
 | ||||
| function MyApp({ Component, pageProps }) { | ||||
|   return <Component {...pageProps} /> | ||||
| function MyApp({ Component, pageProps: { session, ...pageProps } }) { | ||||
|   return ( | ||||
|     <SessionProvider session={session}> | ||||
|       <Component {...pageProps} /> | ||||
|     </SessionProvider> | ||||
|   ); | ||||
| } | ||||
| 
 | ||||
| export default MyApp | ||||
| export default MyApp; | ||||
|  |  | |||
							
								
								
									
										11
									
								
								pages/api/auth/[...nextauth].js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								pages/api/auth/[...nextauth].js
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,11 @@ | |||
| import NextAuth from "next-auth"; | ||||
| import DiscordProvider from "next-auth/providers/discord"; | ||||
| 
 | ||||
| export default NextAuth({ | ||||
|   providers: [ | ||||
|     DiscordProvider({ | ||||
|       clientId: process.env.DISCORD_CLIENT_ID, | ||||
|       clientSecret: process.env.DISCORD_CLIENT_SECRET, | ||||
|     }), | ||||
|   ], | ||||
| }); | ||||
|  | @ -1,8 +1,10 @@ | |||
| import Head from 'next/head' | ||||
| import Image from 'next/image' | ||||
| import styles from '../styles/Home.module.css' | ||||
| import { useSession, signIn, signOut } from "next-auth/react"; | ||||
| import Head from "next/head"; | ||||
| import Image from "next/image"; | ||||
| import styles from "../styles/Home.module.css"; | ||||
| 
 | ||||
| export default function Home() { | ||||
|   const { data: session } = useSession(); | ||||
|   return ( | ||||
|     <div className={styles.container}> | ||||
|       <Head> | ||||
|  | @ -12,58 +14,18 @@ export default function Home() { | |||
|       </Head> | ||||
| 
 | ||||
|       <main className={styles.main}> | ||||
|         <h1 className={styles.title}> | ||||
|           Welcome to <a href="https://nextjs.org">Next.js!</a> | ||||
|         </h1> | ||||
|         <h1 className={styles.title}>Steam Borders</h1> | ||||
| 
 | ||||
|         <p className={styles.description}> | ||||
|           Get started by editing{' '} | ||||
|           <code className={styles.code}>pages/index.js</code> | ||||
|           {session ? `Signed in as ${session.user.name}` : "Not signed in"} | ||||
|           <br /> | ||||
|           {session ? ( | ||||
|             <button onClick={() => signOut()}>Sign Out</button> | ||||
|           ) : ( | ||||
|             <button onClick={() => signIn()}>Sign In</button> | ||||
|           )} | ||||
|         </p> | ||||
| 
 | ||||
|         <div className={styles.grid}> | ||||
|           <a href="https://nextjs.org/docs" className={styles.card}> | ||||
|             <h2>Documentation →</h2> | ||||
|             <p>Find in-depth information about Next.js features and API.</p> | ||||
|           </a> | ||||
| 
 | ||||
|           <a href="https://nextjs.org/learn" className={styles.card}> | ||||
|             <h2>Learn →</h2> | ||||
|             <p>Learn about Next.js in an interactive course with quizzes!</p> | ||||
|           </a> | ||||
| 
 | ||||
|           <a | ||||
|             href="https://github.com/vercel/next.js/tree/canary/examples" | ||||
|             className={styles.card} | ||||
|           > | ||||
|             <h2>Examples →</h2> | ||||
|             <p>Discover and deploy boilerplate example Next.js projects.</p> | ||||
|           </a> | ||||
| 
 | ||||
|           <a | ||||
|             href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" | ||||
|             className={styles.card} | ||||
|           > | ||||
|             <h2>Deploy →</h2> | ||||
|             <p> | ||||
|               Instantly deploy your Next.js site to a public URL with Vercel. | ||||
|             </p> | ||||
|           </a> | ||||
|         </div> | ||||
|       </main> | ||||
| 
 | ||||
|       <footer className={styles.footer}> | ||||
|         <a | ||||
|           href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" | ||||
|           target="_blank" | ||||
|           rel="noopener noreferrer" | ||||
|         > | ||||
|           Powered by{' '} | ||||
|           <span className={styles.logo}> | ||||
|             <Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} /> | ||||
|           </span> | ||||
|         </a> | ||||
|       </footer> | ||||
|     </div> | ||||
|   ) | ||||
|   ); | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue