LLM Notice: This documentation site supports content negotiation for AI agents. Request any page with Accept: text/markdown or Accept: text/plain header to receive Markdown instead of HTML. Alternatively, append ?format=md to any URL. All markdown files are available at /md/ prefix paths. For all content in one file, visit /llms-full.txt
Skip to main content

reauthenticate

A convenience method that calls fcl.unauthenticate() and then fcl.authenticate() for the current user.

This method can only be used in web browsers.

The current user must be authenticated first.

Import​

You can import the entire package and access the function:


_10
import * as fcl from "@onflow/fcl"
_10
_10
fcl.reauthenticate(opts)

Or import directly the specific function:


_10
import { reauthenticate } from "@onflow/fcl"
_10
_10
reauthenticate(opts)

Usage​


_10
import * as fcl from '@onflow/fcl';
_10
// first authenticate to set current user
_10
fcl.authenticate();
_10
// ... somewhere else & sometime later
_10
fcl.reauthenticate();
_10
// logs out user and opens up login/sign-up flow

Parameters​

opts (optional)​

  • Type: {}
  • Description: Authentication options passed to authenticate method

Properties:​

  • service - Optional service to use for authentication
  • redir - Optional redirect flag. Defaults to false.
  • forceReauth - Optional force re-authentication flag. Defaults to false.

Returns​

Promise<CurrentUser>

Promise that resolves to the authenticated CurrentUser object or undefined


Rate this page