Skip to content

Commit fd7af2f

Browse files
fix: address code review comments in PR #40196
1 parent 92b327f commit fd7af2f

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.cursor/docs/references/technical-details.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,13 @@ const axiosInstance = axios.create({
195195
axiosInstance.interceptors.request.use((config) => {
196196
const token = localStorage.getItem("AUTH_TOKEN");
197197
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+
}
199205
}
200206
return config;
201207
});

.cursor/rules/commit/semantic-pr-validator.mdc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,16 @@ function validatePRTitle(title) {
6464

6565
// Extract parts
6666
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+
6777
const type = match[1].toLowerCase();
6878

6979
// Validate type

.cursor/rules/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This index provides an overview of all the rules available for Cursor AI in the
3333
| `verify_feature` | Verifies feature implementation quality | Feature Verifier |
3434
| `generate_tests` | Generates tests for code changes | Test Generator |
3535
| `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) |
3737

3838
## Triggering Rules
3939

0 commit comments

Comments
 (0)