Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AuthenticationPayload

interface

AuthenticationPayload

description

This type is used to describe an authentication payload that contains a user's address. After successful log-in we create a signed cookie that contains some OAuth-related fields such as sub, and already-public information about the logged-in end-user.

Authentication payloads currently consist of:

  • A sub field that contains a log-in operation's completion transaction hash. This permits to scope authenticated sessions and is typically used to describe "one subscription".
  • A address field that contains the authenticated account session's dHealth Network Address. This is typically used as the "username".
  • An optional referralCode field that contains a referral code previously attached to the account that invited the authenticating account to the dApp.

example

Using the AuthenticationPayload interface

const authorizedUser: AuthenticationPayload = {
sub: transaction.transactionInfo.hash,
address: authorizedAddr.pretty(),
};
since

v0.3.0

Hierarchy

  • AuthenticationPayload

Index

Properties

address: string
referralCode?: string
sub: string

Generated using TypeDoc