<template>
<div class="row items-center justify-evenly">
<button label="Test" @click="LoginApp()" />
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { uid } from 'quasar';
import {
SigninWithApple,
AppleSignResponse,
AppleSignOptions,
} from '@diadal/signin-with-apple';
export default defineComponent({
name: 'PageIndex',
setup() {
const options: AppleSignOptions = {
clientId: 'app.example',
redirectURI: 'https://example.com/auth/apple/callback',
scopes: 'email name',
state: '********',
nonce: '**********',
};
function LoginApp() {
SigninWithApple.authorize(options)
.then((result: AppleSignResponse) => {
console.log('result111', result);
})
// eslint-disable-next-line @typescript-eslint/no-explicit-any
.catch((error: any) => {
console.log('error111', error);
});
}
return { LoginApp };
},
});
</script>