code: def find_redirect(key):
      
      rv = (get_url(session.pop(key.lower(), None)) or
            get_url(current_app.config[key.upper()] or None) or '/')
      return rv
docs: Returns the URL to redirect to after a user logs in successfully.
  
      :param key: The session or application configuration key to search for