Giter Site home page Giter Site logo

Comments (5)

chrisabruce avatar chrisabruce commented on July 30, 2024 1

Yeah I use the scopes prop to pass. I will create a PR for rest. Maybe good approach would be to add any common oauth ones to config and maybe the rest as a new property called params or something?

from yew-oauth2.

mh84 avatar mh84 commented on July 30, 2024 1

I'm encountered a similar problem when working with Discords OAuth2, where there is a query option prompt=none which requires the user to allow app permission only once. This works fine for login purposes as we can just use start_login_opts(...), but this doesnt work when there is an redirect because of unauthenticated state.

I was able to cover this problem locally by introducing LoginOptions as property of the OAuth2 struct like this:
` let mut hashmap = HashMap::new();
hashmap.insert("prompt".to_string(), "none".to_string());
let options = LoginOptions { query: hashmap };

html!(
    <>
    <OAuth2 {config} {scopes} {options}>

...`

I can provide a PR with the changes made, if that way looks fine.

from yew-oauth2.

ctron avatar ctron commented on July 30, 2024

I think most of the parameters are standard OAuth2 parameters, which will be set automatically.

But you are right, some of them (like scope) and arbitrary custom parameter can currently not be set. I think it would make sense to amend this though. Would be you able to come up with a PR?

from yew-oauth2.

ctron avatar ctron commented on July 30, 2024

Actually you can set scopes, I was looking in the wrong location 🤦 …

pub scopes: Vec<String>,

For the other parameters, it might make sense to either amend the Config structure. Or, if they are more generic, add them to the component properties too.

from yew-oauth2.

ctron avatar ctron commented on July 30, 2024

As PR #9 is merged and released, can we close this issue?

from yew-oauth2.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.