Home Reference Source
import Auth from '@osjs/client/src/auth.js'
public class | source

Auth

Handles Authentication

Constructor Summary

Public Constructor
public

constructor(core: Core, options: AuthSettings)

Member Summary

Public Members
public

Authentication adapter

public

Core instance reference

public

Authentication UI

Method Summary

Public Methods
public

Destroy authentication handler

public

init(): *

Initializes authentication handler

public

Performs a login

public

Performs a logout

public

register(values: AuthForm): Promise<*>

Performs a register call

public

show(cb: AuthCallback): Promise<boolean>

Shows Login UI

public

shutdown(reload: boolean)

Run the shutdown procedure

Public Constructors

public constructor(core: Core, options: AuthSettings) source

Params:

NameTypeAttributeDescription
core Core

OS.js Core instance reference

options AuthSettings
  • optional
  • default: {}

Auth Options

Public Members

public adapter: AuthAdapter source

Authentication adapter

public core: Core source

Core instance reference

public ui: Login source

Authentication UI

Public Methods

public destroy() source

Destroy authentication handler

public init(): * source

Initializes authentication handler

Return:

*

public login(values: AuthForm): Promise<boolean> source

Performs a login

Params:

NameTypeAttributeDescription
values AuthForm

Form values as JSON

Return:

Promise<boolean>

public logout(reload: boolean): Promise<boolean> source

Performs a logout

Params:

NameTypeAttributeDescription
reload boolean
  • optional
  • default: true

Reload client afterwards

Return:

Promise<boolean>

public register(values: AuthForm): Promise<*> source

Performs a register call

Params:

NameTypeAttributeDescription
values AuthForm

Form values as JSON

Return:

Promise<*>

public show(cb: AuthCallback): Promise<boolean> source

Shows Login UI

Params:

NameTypeAttributeDescription
cb AuthCallback

Authentication callback

Return:

Promise<boolean>

public shutdown(reload: boolean) source

Run the shutdown procedure

Params:

NameTypeAttributeDescription
reload boolean
  • optional

Reload afterwards