-
-
Notifications
You must be signed in to change notification settings - Fork 775
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add clerk integration in /next branch (#364)
* feat: add clerk integration in /next branch * feat: add signin & signup pages, add env variables to env.ts * feat: adds env variables example * feat: dashboard page initialisation * fix: ci environment in pipeline * fix: exposes clerk & upstash env vars to ci * chore: remove forms tailwind plugin --------- Co-authored-by: ManavJoshi <[email protected]> Co-authored-by: Ahmed Elsakaan <[email protected]>
- Loading branch information
1 parent
35de3af
commit a877b31
Showing
14 changed files
with
130 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Authentication | ||
CLERK_SECRET_KEY=<your-clerk-secret-key> | ||
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=<your-clerk-publishable-key> | ||
|
||
# Upstash Redis | ||
UPSTASH_REDIS_REST_URL=<your-upstash-rest-url> | ||
UPSTASH_REDIS_REST_TOKEN=<your-upstash-rest-token> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { SignIn } from '@clerk/nextjs'; | ||
|
||
/** | ||
* The Signin page component. | ||
* | ||
* @returns The signin page. | ||
*/ | ||
export default function Page() { | ||
return ( | ||
<main className="container mx-auto flex min-h-screen items-center justify-center"> | ||
<SignIn /> | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { SignUp } from '@clerk/nextjs'; | ||
|
||
/** | ||
* The Signup page component. | ||
* | ||
* @returns The signup page. | ||
*/ | ||
export default function Page() { | ||
return ( | ||
<main className="container mx-auto flex min-h-screen items-center justify-center"> | ||
<SignUp /> | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { SignOutButton } from '@clerk/nextjs'; | ||
|
||
/** | ||
* This is the main page for the dashboard. | ||
* | ||
* @returns A Next.js RSC page component. | ||
*/ | ||
export default function DashboardHome() { | ||
return ( | ||
<main> | ||
<h1>Hello World</h1> | ||
<SignOutButton /> | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Redis } from '@upstash/redis'; | ||
|
||
import { env } from '@/env'; | ||
|
||
export const redis = new Redis({ | ||
url: env.UPSTASH_REDIS_REST_URL, | ||
token: env.UPSTASH_REDIS_REST_TOKEN, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { clerkMiddleware, createRouteMatcher } from '@clerk/nextjs/server'; | ||
|
||
const isProtectedRoute = createRouteMatcher(['/app(.*)']); | ||
|
||
export default clerkMiddleware((auth, req) => { | ||
if (isProtectedRoute(req)) auth().protect(); | ||
}); | ||
|
||
export const config = { | ||
matcher: ['/((?!.*\\..*|_next).*)', '/', '/(api|trpc)(.*)'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters