Skip to content

Commit

Permalink
Create dedicated signup/signin pages (anti-work#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
slavingia authored Oct 27, 2024
2 parents ece52ef + a35cd52 commit ad2b786
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Used to redirect to /dashboard after sign in
CLERK_SIGN_IN_FALLBACK_REDIRECT_URL=/dashboard
CLERK_SIGN_UP_FALLBACK_REDIRECT_URL=/dashboard
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/signin
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/signup

######################################################
# Everything below is required for Local Development #
Expand Down
23 changes: 23 additions & 0 deletions app/(dashboard)/signin/[[...signin]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import { SignIn } from "@clerk/nextjs";

export default function SignInPage() {
return (
<main className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div className="flex justify-center">
<SignIn appearance={{
elements: {
headerTitle: 'sm:text-xl lg:text-lg xl:text-xl font-bold',
headerSubtitle: 'text-base text-gray-600',
footerActionText: 'text-sm',
footerActionLink: 'text-orange-500 hover:text-orange-600 font-medium',
socialButtonsBlockButtonText: 'text-sm',
socialButtonsBlockButton: 'whitespace-nowrap transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 shadow h-9 bg-white hover:bg-gray-100 border border-gray-200 rounded-full px-12 py-6 inline-flex items-center justify-center',
footer: 'bg-gray-950'
},
}}
/>
</div>
</main>
);
}
22 changes: 22 additions & 0 deletions app/(dashboard)/signup/[[...signup]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import { SignUp } from "@clerk/nextjs";

export default function SignUpPage() {
return (
<main className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div className="flex justify-center">
<SignUp appearance={{
elements: {
headerTitle: 'sm:text-xl lg:text-lg xl:text-xl font-bold',
headerSubtitle: 'text-base text-gray-600',
footerActionText: 'text-sm',
footerActionLink: 'text-orange-500 hover:text-orange-600 font-medium',
socialButtonsBlockButtonText: 'text-sm',
socialButtonsBlockButton: 'whitespace-nowrap transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 shadow h-9 bg-white hover:bg-gray-100 border border-gray-200 rounded-full px-12 py-6 inline-flex items-center justify-center',
footer: 'bg-gray-950'
},
}}/>
</div>
</main>
);
}
6 changes: 6 additions & 0 deletions lib/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,15 @@ async function main() {
const ANTHROPIC_API_KEY = await promptForAnthropicApiKey();
await promptForGitHubOAuth();
const CLERK_SIGN_IN_FALLBACK_REDIRECT_URL = '/dashboard';
const CLERK_SIGN_UP_FALLBACK_REDIRECT_URL = '/dashboard';
const NEXT_PUBLIC_CLERK_SIGN_IN_URL = '/signin';
const NEXT_PUBLIC_CLERK_SIGN_UP_URL = '/signup';

await writeEnvFile({
CLERK_SIGN_IN_FALLBACK_REDIRECT_URL,
CLERK_SIGN_UP_FALLBACK_REDIRECT_URL,
NEXT_PUBLIC_CLERK_SIGN_IN_URL,
NEXT_PUBLIC_CLERK_SIGN_UP_URL,
STRIPE_SECRET_KEY,
STRIPE_WEBHOOK_SECRET,
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY,
Expand Down

0 comments on commit ad2b786

Please sign in to comment.