File tree 3 files changed +18
-2
lines changed
3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,13 @@ const axiosInstance = axios.create({
195
195
axiosInstance .interceptors .request .use ((config ) => {
196
196
const token = localStorage .getItem (" AUTH_TOKEN" );
197
197
if (token ) {
198
- config .headers .Authorization = ` Bearer ${token } ` ;
198
+ // Basic validation - check if token is a valid JWT format
199
+ if (token .split (' .' ).length === 3 ) {
200
+ config .headers .Authorization = ` Bearer ${token } ` ;
201
+ } else {
202
+ // Handle invalid token - could log user out or refresh token
203
+ store .dispatch (refreshToken ());
204
+ }
199
205
}
200
206
return config ;
201
207
});
Original file line number Diff line number Diff line change @@ -64,6 +64,16 @@ function validatePRTitle(title) {
64
64
65
65
// Extract parts
66
66
const match = title.match(/^([a-z]+)(?:\(([a-z0-9-_]+)\))?(!)?:/i);
67
+
68
+ if (!match || !match[1]) {
69
+ return {
70
+ valid: false,
71
+ errors: [
72
+ "Failed to parse PR title format. Please follow the pattern: type(scope): description"
73
+ ]
74
+ };
75
+ }
76
+
67
77
const type = match[1].toLowerCase();
68
78
69
79
// Validate type
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ This index provides an overview of all the rules available for Cursor AI in the
33
33
| ` verify_feature ` | Verifies feature implementation quality | Feature Verifier |
34
34
| ` generate_tests ` | Generates tests for code changes | Test Generator |
35
35
| ` optimize_performance ` | Analyzes code for performance issues | Performance Optimizer |
36
- | ` update_docs ` | Updates documentation based on code changes | Auto Update Docs |
36
+ | ` update_docs ` | Updates documentation based on code changes | [ Auto Update Docs] ( ../hooks/scripts/auto-update-docs.mdc ) |
37
37
38
38
## Triggering Rules
39
39
You can’t perform that action at this time.
0 commit comments