You're viewing the legacy docs. They are deprecated as of May 18, 2016.
These docs are for version 2.4.2 and below of the Javascript SDK. Go to our current docs, or see our Web migration guide.

Version 2.4.2Changelog


Detaches a callback previously attached with onAuth(). Note that if onAuth() was called multiple times with the same callback, the callback will be called multiple times for each event, and this method must be called multiple times to remove each callback.

If a context is specified, the callback and context pair will be used to determine which callback to detach.

var ref = new Firebase("https://<YOUR-FIREBASE-APP>");

// Define a callback to be fired every time authentication state changes
var onAuthCallback = function(authData) {
  if (authData) {
    console.log("Authenticated with uid:", authData.uid);
  } else {
    console.log("Client unauthenticated.")

// Attach the callback

// Sometime later...

// Detach the callback