GogApi


Authentication Module

This module holds everything which is needed to authenticate to the API

Types

Type Description

TokenResponse

Typesafe variant of the response data of https://auth.gog.com/token

Functions and values

Function or value Description

createAuth response

Full Usage: createAuth response

Parameters:
Returns: Authentication option

Creates a new authentication from a TokenResponse

response : Result<TokenResponse, 'a>
Returns: Authentication option

getNewToken redirectUri code

Full Usage: getNewToken redirectUri code

Parameters:
    redirectUri : string
    code : string

Returns: Async<Authentication option>

Uses authentication code to create a Authentication with authorization token

redirectUri : string
code : string
Returns: Async<Authentication option>

getRefreshToken authentication

Full Usage: getRefreshToken authentication

Parameters:
Returns: Async<Authentication option>

Tries to refresh the current authentication. Returns - New Authentication, if token in given authentication expired - otherwise the input

authentication : Authentication
Returns: Async<Authentication option>