google-signin icon indicating copy to clipboard operation
google-signin copied to clipboard

[Request] Polymer 2.0 support

Open borisbsv opened this issue 7 years ago • 4 comments

Most google web componets have a 2.0-preview branch. Is there a chance this will happen soon for the google-signin? Currently, after updating to Polymer 2.0 rc2, I get the following error on clicking the signin button: Uncaught Error: AuthEngine not initialized. gapi has not loaded. at Object.assertAuthInitialized (google-signin-aware.html:418) at Object.signIn (google-signin-aware.html:427) at HTMLElement.signIn (google-signin-aware.html:731) at HTMLElement.signIn (google-signin.html:558) at HTMLDivElement.handler (template-stamp.html:428)

borisbsv avatar Mar 10 '17 11:03 borisbsv

Same here I'm dead in the water...

I've added <script src="https://apis.google.com/js/platform.js"></script> to my index.html, but now the message is about 'auth2' not being loaded:

Uncaught Error: AuthEngine not initialized. auth2 not loaded. at Object.assertAuthInitialized (google-signin-aware.html:421) at Object.signIn (google-signin-aware.html:427) at HTMLElement.signIn (google-signin-aware.html:731) at HTMLElement.signIn (google-signin.html:558) at HTMLDivElement.handler (template-stamp.html:92) assertAuthInitialized @ google-signin-aware.html:421 signIn @ google-signin-aware.html:427 signIn @ google-signin-aware.html:731 signIn @ google-signin.html:558 handler @ template-stamp.html:92

I need to somehow have this working by Friday Apr 21. Eeeek!

AndrewBarfield avatar Apr 19 '17 19:04 AndrewBarfield

@TemplarRei @AndrewBarfield add this to index.html:

<script src="https://apis.google.com/js/api.js"></script>
<script>
  function start() {
  // Initialize the JavaScript client library.
  gapi.client.init({
    'apiKey': '',
    // clientId and scope are optional if auth is not required.
    'clientId': '',
    'scope': ''})
  };
</script>

and in your module:

connectedCallback() {
  super.connectedCallback();
  // Load the JavaScript client library.
  gapi.load('client', start);

krisu7 avatar Aug 04 '17 11:08 krisu7

Thanks, @krisu7, we just restarted development on the migration and this should be quite helpful 👍

borisbsv avatar Aug 04 '17 12:08 borisbsv

@TemplarRei You're welcome, I just had the same problem and this was only solution that worked for me.

krisu7 avatar Aug 04 '17 13:08 krisu7