File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,9 +88,8 @@ export async function POST(request: NextRequest) {
8888 ) ;
8989 } catch ( error ) {
9090 dev . error ( "Registration error:" , error , { tag : "auth" } ) ;
91- const message = error instanceof Error ? error . message : String ( error ) ;
9291 return NextResponse . json (
93- { error : "An error occurred during registration" , debug : message } ,
92+ { error : "An error occurred during registration" } ,
9493 { status : 500 } ,
9594 ) ;
9695 }
Original file line number Diff line number Diff line change @@ -95,14 +95,19 @@ export async function checkRateLimit(
9595 return { success : true } ;
9696 }
9797
98- const result = await limiter . limit ( identifier ) ;
99-
100- return {
101- success : result . success ,
102- limit : result . limit ,
103- remaining : result . remaining ,
104- reset : result . reset ,
105- } ;
98+ try {
99+ const result = await limiter . limit ( identifier ) ;
100+
101+ return {
102+ success : result . success ,
103+ limit : result . limit ,
104+ remaining : result . remaining ,
105+ reset : result . reset ,
106+ } ;
107+ } catch ( error ) {
108+ console . error ( "Rate limiting error (failing open):" , error ) ;
109+ return { success : true } ;
110+ }
106111}
107112
108113/**
You can’t perform that action at this time.
0 commit comments