File tree 1 file changed +6
-2
lines changed
src/app/(backend)/middleware/auth
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,18 @@ export const checkAuth =
48
48
nextAuthAuthorized : oauthAuthorized ,
49
49
} ) ;
50
50
} catch ( e ) {
51
+ const params = await options . params ;
52
+
51
53
// if the error is not a ChatCompletionErrorPayload, it means the application error
52
54
if ( ! ( e as ChatCompletionErrorPayload ) . errorType ) {
53
55
if ( ( e as any ) . code === 'ERR_JWT_EXPIRED' )
54
56
return createErrorResponse ( ChatErrorType . SystemTimeNotMatchError , e ) ;
55
57
56
58
// other issue will be internal server error
57
- return createErrorResponse ( ChatErrorType . InternalServerError , e ) ;
59
+ return createErrorResponse ( ChatErrorType . InternalServerError , {
60
+ error : e ,
61
+ provider : params ?. provider ,
62
+ } ) ;
58
63
}
59
64
60
65
const {
@@ -65,7 +70,6 @@ export const checkAuth =
65
70
66
71
const error = errorContent || e ;
67
72
68
- const params = await options . params ;
69
73
return createErrorResponse ( errorType , { error, ...res , provider : params ?. provider } ) ;
70
74
}
71
75
You can’t perform that action at this time.
0 commit comments