Skip to content

Commit

Permalink
adding auth0 login
Browse files Browse the repository at this point in the history
  • Loading branch information
Pious1020 committed Nov 12, 2024
1 parent a42a0ec commit 987e950
Show file tree
Hide file tree
Showing 5 changed files with 234 additions and 12 deletions.
4 changes: 4 additions & 0 deletions app/api/auth/[auth0]/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { handleAuth } from '@auth0/nextjs-auth0';

export const GET = handleAuth();

15 changes: 9 additions & 6 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { Metadata } from "next";
import localFont from "next/font/local";
import "./globals.css";
import React from "react";
import { UserProvider } from "@auth0/nextjs-auth0/client";

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
Expand Down Expand Up @@ -51,13 +52,15 @@ export default function RootLayout({
return (
<html lang="en">
<head>
<link rel="icon" href="/pawicon.png" type="image/icon" />
<link rel="icon" href="/pawicon.png" type="image/icon" />
</head>
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
</body>
<UserProvider>
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
</body>
</UserProvider>
</html>
);
}
6 changes: 3 additions & 3 deletions components/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const Navigation = () => {
<Link href="/events" className="text-gray-600 hover:text-blue-600 transition-colors">
Events
</Link>
<Link href="/authentication">
<Link href="/api/auth/login">
<Button className="bg-blue-600 hover:bg-blue-700">
Sign In
</Button>
Expand Down Expand Up @@ -125,7 +125,7 @@ const HeroSection = () => (
variants={fadeIn}
className="flex flex-col sm:flex-row justify-center gap-4"
>
<Link href="/authentication">
<Link href="/api/auth/login">
<Button size="lg" className="bg-blue-600 hover:bg-blue-700">
Join Now <ChevronRight className="ml-2 h-4 w-4" />
</Button>
Expand Down Expand Up @@ -233,7 +233,7 @@ const CTASection = () => (
</motion.p>
<motion.div variants={fadeIn}>
<motion.div whileHover={{scale: 1.05}} whileTap={{scale: 0.95}}>
<Link href="/authentication">
<Link href="/api/auth/login">
<Button size="lg" className="bg-white text-blue-600 hover:bg-blue-50">
Sign Up Now <ChevronRight className="ml-2 h-4 w-4" />
</Button>
Expand Down
218 changes: 216 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 987e950

Please sign in to comment.