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

How to combine two hello.init into one? #512

Closed
hongbo-miao opened this issue Jul 29, 2017 · 2 comments
Closed

How to combine two hello.init into one? #512

hongbo-miao opened this issue Jul 29, 2017 · 2 comments

Comments

@hongbo-miao
Copy link

hongbo-miao commented Jul 29, 2017

Originally posted on Stack Overflow.


I am trying to use hello.js init API to sign in Microsoft Graph later. The code below is how I am doing now and it works.

repo

However, is there a way to combine these two hello.init into one? Thanks

    hello.init({
      msft: {
        oauth: {
          version: 2,
          auth: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize'
        },
        scope_delim: ' ',
        form: false
      }
    });
    
    hello.init({
      msft: myAppId
    }, {
      redirect_uri: window.location.href
    });
@MrSwitch
Copy link
Owner

So
hello.init ({msft:appid}) is short for hello.init ({msft:{id:appid}})` so you just need to define an id prop on your definition and it'll all work. Fyi this is undocumented and may change in the future.

@hongbo-miao
Copy link
Author

hongbo-miao commented Jul 29, 2017

Works perfect. Thank you so much @MrSwitch !

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

No branches or pull requests

2 participants