Thanks to visit codestin.com
Credit goes to clerk.com

Skip to main content
Docs

auth()

The auth() helper returns the AuthCodestin Search App object of the currently active user.

Parameters

  • Name
    opts?
    Type
    {acceptsToken: TokenType, treatPendingAsSignedOut: boolean }
    Description

    An optional object that can be used to configure the behavior of the auth() function. It accepts the following properties:

    • acceptsToken?: The type of authentication token(s) to accept. Valid values are:

      • 'session_token' - authenticates a user session.
      • 'oauth_token' - authenticates a machine request using OAuth.
      • 'm2m_token' - authenticates a machine to machine request.
      • 'api_key' - authenticates a machine request using API keys.

      Can be set to:

      • A single token type.
      • An array of token types.
      • 'any' to accept all available token types.

      Defaults to 'session_token'.

    • treatPendingAsSignedOut?: A boolean that indicates whether to treat pending session statusCodestin Search App as signed out. Defaults to true.

Returns

auth() returns the AuthCodestin Search App object.

Usage

See the dedicated guideCodestin Search App for example usage.

Feedback

What did you think of this content?

Last updated on