Othent
  • 👋Welcome to Othent
  • 🥪JS SDK
    • Getting Started
    • Events
    • Error Handling
    • Binary Data Types Utils
    • TypeScript Types
    • Config Constants
  • 🥪JS SDK API
    • constructor()
    • startTabSynching()
    • completeConnectionAfterRedirect()
    • connect()
    • disconnect()
    • requireAuth()
    • isAuthenticated
    • getActiveAddress()
    • getActivePublicKey()
    • getAllAddresses()
    • getWalletNames()
    • getUserDetails()
    • getSyncActiveAddress()
    • getSyncActivePublicKey()
    • getSyncAllAddresses()
    • getSyncWalletNames()
    • getSyncUserDetails()
    • sign() (transaction)
    • dispatch() (transaction)
    • encrypt()
    • decrypt()
    • signature()
    • signDataItem()
    • signMessage()
    • verifyMessage()
    • privateHash()
    • walletName
    • walletVersion
    • config
    • getArweaveConfig()
    • getPermissions()
  • Demos
    • 🍏SDK playground / demo
    • 🍏SDK playground / demo GitHub
    • 🍎File upload app example
    • 🍎File upload app example GitHub
  • 📚External libraries
    • arweave-js
    • Arweave Wallet Kit
  • Additional Links
    • 🌐Othent.io
    • 🌐Discord
    • 🌐GitHub
    • 🌐X
Powered by GitBook
On this page
  • API
  • callbackUriWithParams?: Auth0RedirectUriWithParams
  • return Promise<UserDetails | null>
  • Example usage
  1. JS SDK API

completeConnectionAfterRedirect()

Othent JS SDK completeConnectionAfterRedirect() function

PreviousstartTabSynching()Nextconnect()

Last updated 8 months ago

If and only if you set the option, users will be redirected to Auth0 to authenticate and then back to your application. When they land back in your application, you must call completeConnectionAfterRedirect() to complete the authentication process.

By default, callbackUriWithParams = location.href, if you environment supports it. Otherwise, you'll have to manually pass an URI with the code and state params provided by Auth0, which handles the redirect callback.

See .

API

completeConnectionAfterRedirect(
  callbackUriWithParams?: Auth0RedirectUriWithParams,
): Promise<UserDetails | null>;

callbackUriWithParams?: Auth0RedirectUriWithParams

Default: location.href

URI with code and state params provided by Auth0.

return Promise<UserDetails | null>

A Promise with the UserDetails or null if the log in modal was closed, could not even be opened or authentication failed.

Example usage

import { Othent } from "@othent/kms";

const MyComponent = () => {
  const othent = useMemo(() => {
    return new Othent(options);
  }, [options]);

  useEffect(() => {
    othent.completeConnectionAfterRedirect();
  }, [othent])
}
🥪
Auth0's handleRedirectCallback
auth0LogInMethod = "redirect"