how to specify the redirect url for the google sign-in button

后端 未结 4 918
悲&欢浪女
悲&欢浪女 2021-01-12 10:44

i was wondering how to specify the redirect url for a google sign-in button, here is the button:

 
4条回答
  •  轮回少年
    2021-01-12 11:15

    As of June 2020, can you do it like this. Documentation : https://developers.google.com/identity/sign-in/web/reference

    function renderButton() {
          gapi.signin2.render('my-signin2', {
            'scope': 'profile email',
            'width': 240,
            'height': 50,
            'longtitle': true,
            'theme': 'dark',
            'ux_mode': 'redirect',
            'redirect_uri': 'REDIRECT URL HERE',
            'onsuccess': onSuccess,
            'onfailure': onFailure
          });
        }
    

提交回复
热议问题