Open
Conversation
Signed-off-by: goldrak <goldrak@gmail.com>
thc202
reviewed
Feb 9, 2024
authentication/LaravelInertia.js
Outdated
Comment on lines
60
to
62
| var dataPageObject; | ||
|
|
||
| dataPageObject = JSON.parse(dataPageJsonString); |
Member
There was a problem hiding this comment.
var dataPageObject = JSON.parse(dataPageJsonString);
authentication/LaravelInertia.js
Outdated
| secondMsg.getRequestHeader().setHeader("X-XSRF-TOKEN", decodeURIComponent(csrfTokenValue)); | ||
| secondMsg.getRequestHeader().setHeader("Content-Type", "application/json"); | ||
| secondMsg.getRequestHeader().setHeader("X-Requested-With", "XMLHttpRequest"); | ||
| secondMsg.getRequestHeader().setHeader("Referer", "https://app.opensecdevops.com/login"); |
Member
There was a problem hiding this comment.
I'd expect this to use baseURL, if not possible it should be a required parameter.
Author
There was a problem hiding this comment.
Yes this a big error of the testing sorry
Comment on lines
78
to
87
| secondMsg.getRequestHeader().setHeader("X-XSRF-TOKEN", decodeURIComponent(csrfTokenValue)); | ||
| secondMsg.getRequestHeader().setHeader("Content-Type", "application/json"); | ||
| secondMsg.getRequestHeader().setHeader("X-Requested-With", "XMLHttpRequest"); | ||
| secondMsg.getRequestHeader().setHeader("Referer", "https://app.opensecdevops.com/login"); | ||
| secondMsg.getRequestHeader().setHeader("X-Inertia", 'true'); | ||
| secondMsg.getRequestHeader().setHeader("X-Inertia-Version", inertiaVersion); | ||
| secondMsg.getRequestHeader().setHeader("Accept", "text/html, application/xhtml+xml"); | ||
|
|
||
| // Send cookies | ||
| secondMsg.getRequestHeader().setHeader(HttpHeader.COOKIE, "XSRF-TOKEN=" + csrfTokenValue + "; osdo_session=" + cookieSessionValue); |
Member
There was a problem hiding this comment.
Could use secondRequestHeader instead of the getter.
authentication/LaravelInertia.js
Outdated
| helper.sendAndReceive(secondMsg, false); | ||
|
|
||
| // Get the status code of the response. | ||
| // Aquí puedes verificar el código de estado de la respuesta para confirmar si la autenticación fue exitosa |
| // | ||
|
|
||
| // Build message. | ||
| var firstRequestURI = new URI(targetURL, false); |
Member
There was a problem hiding this comment.
I'd have expected the URLs to be properly encoded.
Author
There was a problem hiding this comment.
I don't understand the problem, it's how I saw it being done here
https://github.com/GoldraK/community-scripts/blob/main/authentication/DjangoAuthentication.js#L29
|
|
||
|
|
||
| function getRequiredParamsNames() { | ||
| return ["Target URL", "Username field", "Password field", "Session Cookie name"]; |
authentication/LaravelInertia.js
Outdated
|
|
||
|
|
||
| function getOptionalParamsNames() { | ||
| return ["Extra POST data"]; |
Member
|
The changelog should be updated. |
Signed-off-by: goldrak <goldrak@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
Based on Django Auth I have created Laravel + Inertiajs Auth.