11import { AuthingSSO } from './index'
22
33const auth = new AuthingSSO ( {
4- appId : 'AUTHING_APP_ID ' ,
4+ appId : '60dd57882376f4bb789dbfe1 ' ,
55
66 // SSO 应用面板地址
7- origin : 'https://{SSO 应用面板地址}.authing .cn' ,
7+ origin : 'https://hep-center.u2.hep.com .cn' ,
88
99 // 应用登录回调 URL
10- redirectUri : 'http://localhost:3001/login/callback '
10+ redirectUri : 'http://localhost:3004/ '
1111} )
1212
1313window . onload = async function ( ) {
1414 let res = await auth . trackSession ( )
15+ let etextbookproRes = await auth . getEtextbookproAccessTokenSilently ( )
16+ console . log ( etextbookproRes , 'etextbookproRes' )
1517 if ( res . session !== null ) {
1618 document . getElementById ( 'h1-user-info' ) . style . display = 'block'
1719 document . getElementById ( 'user-info' ) . innerHTML = JSON . stringify ( res . userInfo , null , 4 )
@@ -25,8 +27,7 @@ window.onload = async function () {
2527document . getElementById ( 'btn-login' ) . addEventListener ( 'click' , function ( ) {
2628 auth . login ( {
2729 scope : 'openid profile email phone' ,
28- responseMode : 'fragment' ,
29- responseType : 'code token' ,
30+ responseType : 'code' ,
3031 state : Math . random ( ) . toString ( ) ,
3132 nonce : Math . random ( ) . toString ( )
3233 } )
0 commit comments