javascript - How to combine two `hello.init` into one? -


i trying use hello.js init api sign in microsoft graph later. code below how doing , works.

repo

however, there way combine these 2 hello.init 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 }); 

i got answer creator of hello.js andrew dodson on github.

hello.init ({msft:appid}) short hello.init ({msft:{id:appid}}) need define id prop on definition , it'll work. fyi undocumented , may change in future.

so in case, solution

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

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -