File tree Expand file tree Collapse file tree 3 files changed +25
-4
lines changed
Expand file tree Collapse file tree 3 files changed +25
-4
lines changed Original file line number Diff line number Diff line change 55# DATABASE_URL=postgresql://postgres:password@db:5432/postgres
66# PUBLIC_ENV=production # or staging
77# PUBLIC_COMMIT=$SOURCE_COMMIT
8+ # RACK_ATTACK_BYPASS= # rate limit bypass
89
910PUBLIC_ENV = dev
1011
Original file line number Diff line number Diff line change @@ -132,15 +132,22 @@ export async function GET(event) {
132132 // Check Hackatime trust
133133 const hackatimeTrust = (
134134 await (
135- await fetch ( `https://hackatime.hackclub.com/api/v1/users/${ slack_id } /trust_factor` )
135+ await fetch ( `https://hackatime.hackclub.com/api/v1/users/${ slack_id } /trust_factor` , {
136+ headers : env . RACK_ATTACK_BYPASS
137+ ? {
138+ RACK_ATTACK_BYPASS : env . RACK_ATTACK_BYPASS
139+ }
140+ : { }
141+ } )
136142 ) . json ( )
137143 ) [ 'trust_level' ] ;
138144
139145 if ( ! hackatimeTrust ) {
140146 console . error ( ) ;
141- return error ( 503 , {
142- message : 'failed to fetch hackatime trust factor, please try again later'
143- } ) ;
147+ return redirect ( 302 , '/auth/create-hackatime-account' ) ;
148+ // return error(503, {
149+ // message: 'failed to fetch hackatime trust factor, please try again later'
150+ // });
144151 } else if ( hackatimeTrust === 'red' ) {
145152 // Prevent login
146153 return redirect ( 302 , 'https://fraud.land' ) ;
Original file line number Diff line number Diff line change 1+ <script >
2+ import Head from " $lib/components/Head.svelte" ;
3+ </script >
4+
5+ <Head title =" Auth failed" />
6+
7+ <div class =" text-center mt-10" >
8+ <h1 class =" text-2xl" >Hackatime account not found</h1 >
9+
10+ <p >Make sure you have a Hackatime account associated with your Hack Club Auth or Slack account.</p >
11+ <a href =" https://hackatime.hackclub.com/" class =" underline mr-3" >Make one?</a >
12+ <a href =" /auth/idv" class =" underline" >Try again</a >
13+ </div >
You can’t perform that action at this time.
0 commit comments