File tree Expand file tree Collapse file tree 6 files changed +31
-11
lines changed Expand file tree Collapse file tree 6 files changed +31
-11
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ import { NextRequest } from 'next/server'
55const errRedir = ( err : any ) => redirect ( '/slack-error?err=' + err . toString ( ) )
66
77export async function GET ( request : NextRequest ) {
8+ return redirect ( '/slack-error?err=High Seas has ended! Sign-ups are disabled.' )
9+ /*
810 const code = request.nextUrl.searchParams.get('code')
911
1012 const redirectUri = await getRedirectUri()
@@ -41,4 +43,5 @@ export async function GET(request: NextRequest) {
4143 // }).then((d) => d.json());
4244
4345 redirect('/signpost')
46+ */
4447}
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ export default function EmailSubmissionForm() {
1717 const plausible = usePlausible ( )
1818
1919 const handleForm = async ( formData : FormData ) => {
20+ setErrorText ( 'High Seas has ended! Sign-ups are disabled.' )
21+ return
22+ /*
2023 const emailStr = (formData.get('email') as string).trim().toLowerCase()
2124
2225 if (t) {
@@ -55,6 +58,7 @@ export default function EmailSubmissionForm() {
5558 ])
5659 setEmail(emailStr)
5760 plausible('sign-up')
61+ */
5862 }
5963
6064 let origin = ''
@@ -66,6 +70,10 @@ export default function EmailSubmissionForm() {
6670 return (
6771 < >
6872 < div className = "flex flex-col" >
73+ < div className = "px-6 py-4 rounded-lg text-md border-2 border-[#3852CD] bg-[#FA4C3599] text-white" >
74+ High Seas has ended! Sign-ups are disabled.
75+ </ div >
76+ { /*
6977 <form
7078 ref={formRef}
7179 action={handleForm}
@@ -94,6 +102,7 @@ export default function EmailSubmissionForm() {
94102 You need to enter an Email
95103 </div>
96104 )}
105+ */ }
97106 </ div >
98107
99108 < Modal isOpen = { ! ! email } close = { ( ) => setEmail ( undefined ) } >
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ export async function handleEmailSubmission(
2121 username : string
2222 key : string
2323} | null > {
24+ throw new Error ( 'High Seas has ended! Sign-ups are disabled.' )
25+
26+ /*
2427 if (!email) throw new Error('No email supplied to handleEmailSubmission')
2528 if (!userAgent)
2629 throw new Error('No user agent supplied to handleEmailSubmission')
@@ -51,4 +54,5 @@ export async function handleEmailSubmission(
5154 username,
5255 key,
5356 }
57+ */
5458}
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ export default function SlackAuthErrorPage({
1616 reportError ( err )
1717 } , [ ] )
1818
19+ const isSignupDisabled = err ?. includes ( "Sign-ups are currently disabled" )
20+
1921 return (
2022 < div className = "min-h-screen flex items-center justify-center bg-[#4A154B]" >
2123 < div className = "w-fit bg-white p-8 rounded-lg shadow-lg text-center" >
@@ -24,13 +26,13 @@ export default function SlackAuthErrorPage({
2426 aria-hidden = "true"
2527 />
2628 < h1 className = "text-2xl font-bold text-gray-900 mb-2" >
27- Going overboard!
29+ { isSignupDisabled ? "Sign-ups are closed!" : " Going overboard!" }
2830 </ h1 >
2931 < p className = "text-gray-600 mb-6 text-sm" >
30- We Arrrr over capacity right now, but we got your request to join the
31- crew... we'll reach out once we figure out how to keep this ship from
32- capsizing.
33- { err || 'An error occurred during Slack authentication.' }
32+ { isSignupDisabled
33+ ? "High Seas has ended! Sign-ups are disabled."
34+ : "We Arrrr over capacity right now, but we got your request to join the crew... we'll reach out once we figure out how to keep this ship from capsizing." }
35+ { ! isSignupDisabled && ( err || 'An error occurred during Slack authentication.' ) }
3436 </ p >
3537
3638 < Link className = { buttonVariants ( { variant : 'outline' } ) } href = "/" >
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export async function createMagicSession(magicCode: string) {
3838 try {
3939 const partialPersonData = await getPersonByMagicToken ( magicCode )
4040 if ( ! partialPersonData )
41- throw new Error ( `Failed to look up Person by magic code: ${ magicCode } ` )
41+ throw new Error ( 'High Seas has ended! Sign-ups are disabled.' )
4242
4343 const { id, email, slackId } = partialPersonData
4444
Original file line number Diff line number Diff line change @@ -105,6 +105,10 @@ export async function createSlackSession(slackOpenidToken: string) {
105105 let person = ( await getSelfPerson ( payload . sub as string ) ) as any
106106
107107 if ( ! person ) {
108+ // Sign-ups are disabled
109+ throw new Error ( 'High Seas has ended! Sign-ups are disabled.' )
110+
111+ /*
108112 const body = JSON.stringify({
109113 performUpsert: {
110114 fieldsToMergeOn: ['email'],
@@ -142,12 +146,9 @@ export async function createSlackSession(slackOpenidToken: string) {
142146 })
143147
144148 person = result.records[0]
149+ */
145150 }
146-
147- if ( ! person )
148- throw new Error (
149- "Couldn't find OR create a person! :(( Sad face. Tell malted that Airtable broke" ,
150- )
151+
151152
152153 const sessionData : HsSession = {
153154 personId : person . id ,
@@ -166,6 +167,7 @@ export async function createSlackSession(slackOpenidToken: string) {
166167 }
167168}
168169
170+
169171export async function getRedirectUri ( ) : Promise < string > {
170172 const headersList = headers ( )
171173 const host = headersList . get ( 'host' ) || ''
You can’t perform that action at this time.
0 commit comments