BlueForge Docs

client.auth.getSession

Get the current auth session.

Signature

class Client {
  auth: {
    getSession(): Promise<AuthSession | null>
  }
}

Examples

const session = await bf.auth.getSession()
if (session) {
  console.log(`Authenticated as ${session.user.email}`)
} else {
  console.log('Not authenticated')
}

Throws

ErrorCondition
ApiError
API request failed
NetworkError
Network issue

Pitfalls

  • Null means unauthenticated — a null return means no valid session exists

See also

{auto-injected}

Tested against

{auto-injected}