title: Swift & Firebase: Detect revoked token
body: <p>I wonder how the client (iOS) is informed on the revoked token as it is said in this guide by Google:</p>
  <p>How can I detect (on the client device) that the token was revoked and act accordingly (either re-authenticate or sign out)?</p>
  <blockquote>
  <p><strong>Respond to token revocation on the client</strong></p>
  <p>If the token is revoked via the Admin SDK, the client is informed of the revocation and the user is expected to reauthenticate or is signed out:</p>
  </blockquote>
  <p>EXAMPLE BY GOOGLE:</p>
  <pre><code>function onIdTokenRevocation() {
    // For an email/password user. Prompt the user for the password again.
      let password = prompt('Please provide your password for reauthentication');
      let credential = firebase.auth.EmailAuthProvider.credential(
      firebase.auth().currentUser.email, password);
      firebase.auth().currentUser.reauthenticateWithCredential(credential)
      .then(result =&gt; {
        // User successfully reauthenticated. New ID tokens should be valid.
      })
      .catch(error =&gt; {
        // An error occurred.
      });
  }
  </code></pre>