blob: 01cd92409c76313c07ad6a83eb271939919cb126 [file] [log] [blame]
Adrià Vilanova Martínezf7ee6582021-09-02 21:53:28 +02001<script>
2import config from './config.json5';
3
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>