NavBar component not updating state on login

I have a NavBar component which has a signedIn flag. When I return from my federated signin (Cognito hosted UI), this property needs to be updated to true. However, this only happens if I do a browser refresh, which triggers my mounted() function again, which has code to check and reset this flag. How can my NavBar component be aware of when I’m redirected back to my app in order to update this flag? Can the component watch the router somehow?

This is the script portion of my NavBar:

import { Auth } from 'aws-amplify';

export default {
  name: 'NavBar',
  data() {
    return {
      email: {},
      signedIn: false,
  mounted() {
      .then(session => { = session.getIdToken();
        this.signedIn = true;
      .catch(() => {
        console.log('not signed in...');
        this.signedIn = false;
  methods: {
    openHostedUI: () => {