Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Que chille #121

Merged
merged 119 commits into from
Sep 22, 2024
Merged

Que chille #121

merged 119 commits into from
Sep 22, 2024

Conversation

TobiasMaciel
Copy link
Contributor

No description provided.

carlosferreyra and others added 30 commits August 25, 2024 18:27
This commit removes the "id" field from the Alumno model and alters the "dni" and "legajo" fields. The "id" field is no longer needed as it is automatically generated by Django. The "dni" field is now set as the primary key, and the "legajo" field is set as unique. These changes improve the data structure and integrity of the Alumno model.
@TobiasMaciel TobiasMaciel merged commit 50a6fa8 into main Sep 22, 2024
6 of 8 checks passed
Cookies.set('refresh_token', data.refresh);
Cookies.set('access_expiration', data.access_expiration);
Cookies.set('refresh_expiration', data.refresh_expiration);
Cookies.set('username', data.user.username);
Cookies.set('username', data.user.dni);

Check warning

Code scanning / CodeQL

Clear text transmission of sensitive cookie Medium

Sensitive cookie sent without enforcing SSL encryption.

Copilot Autofix AI 2 months ago

To fix the problem, we need to ensure that the username cookie, along with other cookies, is only transmitted over HTTPS. This can be achieved by setting the secure attribute when setting the cookies. Additionally, it is a good practice to set the httpOnly attribute to prevent client-side scripts from accessing the cookies, further enhancing security.

  • Modify the Cookies.set calls to include the secure and httpOnly attributes.
  • Ensure that all cookies set in the FetchLogin function are updated accordingly.
Suggested changeset 1
FrontAdmin/src/API/Login.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/FrontAdmin/src/API/Login.ts b/FrontAdmin/src/API/Login.ts
--- a/FrontAdmin/src/API/Login.ts
+++ b/FrontAdmin/src/API/Login.ts
@@ -17,7 +17,7 @@
       console.log(data);
-      Cookies.set('tokennn', data.access);
-      Cookies.set('refresh_token', data.refresh);
-      Cookies.set('access_expiration', data.access_expiration);
-      Cookies.set('refresh_expiration', data.refresh_expiration);
-      Cookies.set('username', data.user.dni);
+      Cookies.set('tokennn', data.access, { secure: true, httpOnly: true });
+      Cookies.set('refresh_token', data.refresh, { secure: true, httpOnly: true });
+      Cookies.set('access_expiration', data.access_expiration, { secure: true, httpOnly: true });
+      Cookies.set('refresh_expiration', data.refresh_expiration, { secure: true, httpOnly: true });
+      Cookies.set('username', data.user.dni, { secure: true, httpOnly: true });
       return data;
EOF
@@ -17,7 +17,7 @@
console.log(data);
Cookies.set('tokennn', data.access);
Cookies.set('refresh_token', data.refresh);
Cookies.set('access_expiration', data.access_expiration);
Cookies.set('refresh_expiration', data.refresh_expiration);
Cookies.set('username', data.user.dni);
Cookies.set('tokennn', data.access, { secure: true, httpOnly: true });
Cookies.set('refresh_token', data.refresh, { secure: true, httpOnly: true });
Cookies.set('access_expiration', data.access_expiration, { secure: true, httpOnly: true });
Cookies.set('refresh_expiration', data.refresh_expiration, { secure: true, httpOnly: true });
Cookies.set('username', data.user.dni, { secure: true, httpOnly: true });
return data;
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants