Skip to content

Conversation

saurL
Copy link

@saurL saurL commented May 20, 2025

and a function to send a http 302 reponse insteand of a 200 so the user can be directly redirected instead of redirected with the use of script in the body of the page

@FabianLars
Copy link
Owner

Thanks for the contribution! I think we can simplify/merge the Config with the old one and same for the pub function.

For example we can make the behavior switch if redirect_uri is set.

We'll also have to document that the handler does not receive the full url anymore and that users have to handle that themselves on the redirected page.

@saurL
Copy link
Author

saurL commented May 20, 2025

handler actually still receive the full url with

    let url = format!("http://{}:{}{}", "127.0.0.1", port, path);
    return Some(url);

I just didn't handle it the same way you did.

I did not understand why you chose to make the body create a new call the the localhost instead of returning the url directlly btw.

Good idea for merging the configurations. I knew what i did would need to be refactored

@FabianLars
Copy link
Owner

I did not understand why you chose to make the body create a new call the the localhost instead of returning the url directlly btw.

oauth redirects usually send the token after the # in the url. The browser does not send that part to the server (the plugin in this case). Therefore we read the full url on the client side and send it manually.

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.

2 participants