Query.token()

Get the current token.

Signature

Query.token(): Any | Null

Description

The token() method gets the current session Token document or JSON Web Token (JWT) payload.

Parameters

None

Return value

One of:

Type Description

Any

Token document or JWT payload.

Null

null: The current session is a Key session.

Examples

Query.token()
{
  id: "369530580236238881",
  coll: Token,
  ts: Time("2023-07-06T19:11:13.570Z"),
  document: Person.byId("369515102952488993")
}

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!