_App.vue_
```html
```
```js
import { onAuthUIStateChange } from '@aws-amplify/ui-components'
export default {
name: 'AuthStateApp',
created() {
this.unsubscribeAuth = onAuthUIStateChange((authState, authData) => {
this.authState = authState;
this.user = authData;
})
},
data() {
return {
user: undefined,
authState: undefined,
unsubscribeAuth: undefined
}
},
beforeUnmount() {
this.unsubscribeAuth();
}
}
```
```js
import { onAuthUIStateChange } from '@aws-amplify/ui-components'
export default {
name: 'AuthStateApp',
created() {
this.unsubscribeAuth = onAuthUIStateChange((authState, authData) => {
this.authState = authState;
this.user = authData;
})
},
data() {
return {
user: undefined,
authState: undefined,
unsubscribeAuth: undefined
}
},
beforeDestroy() {
this.unsubscribeAuth();
}
}
```