blob: 7cb9f1d2b3c8b53f7813ed39f2c8ceb2c14b37f3 [file] [log] [blame]
Adrià Vilanova Martínezf7ee6582021-09-02 21:53:28 +02001<script>
Adrià Vilanova Martíneze877a002021-09-03 22:03:01 +02002import config from './config.js';
Adrià Vilanova Martínezf7ee6582021-09-02 21:53:28 +02003
4export default {
5 mounted() {
6 if (document.readyState == 'complete')
7 this.init();
8 else
9 window.addEventListener('load', () => this.init());
10 },
11 methods: {
12 init() {
13 window.google.accounts.id.initialize({
14 client_id: config.google.clientId,
15 callback: this.onSignIn,
16 });
17 window.google.accounts.id.renderButton(document.getElementById('gsi-button'), {
18 theme: 'outline',
19 size: 'large',
20 });
21 },
22 onSignIn(response) {
23 this.$emit('on-signin', response);
24 },
25 },
26};
27</script>
28
29<template>
30 <div id="gsi-button"></div>
31</template>