Module bauplan.authentication

Authentication instance

var Authentication = require("bauplan.authentication");

or as part of the Bauplan bundle

var Bauplan = require("bauplan");
var Authentication = Bauplan.Authentication;

To find out whether the user is logged in

var logged = Authentication.loggedIn();

To find out whether the user is registered

var registered = Authentication.registered();

To find out whether the user is logged in through a third party

var registered = Authentication.viaExternalProvider();

To find out whether the user’s account is locked

var locked = Authentication.locked();

To find out whether the user is geoblocked

var geoblocked = Authentication.geoBlocked();

To find out whether the user has failed age verification

var ageblocked = Authentication.ageverificationBlocked();

Additionally, the authentication instance provides access to the following user info

  • session
  • provider
  • entry
Listens to Events
Returns

BauplanAuthentication

Type
instance

Extends

  • Thorax.Model

Requires

  • thorax
  • jquery
Source:
See:

Members

(inner) defaults

Properties:
Name Type Default Description
loggedIn boolean false
registered boolean false
loggedIn boolean false
geoblocked boolean false
Source:

Methods

ageverificationBlocked() → {boolean}

Returns whether user has failed age verification

Source:
Returns
Type
boolean

geoBlocked() → {boolean}

Returns whether user's account is geo-blocked

Source:
Returns
Type
boolean

locked() → {boolean}

Returns whether user's account is locked

Source:
Returns
Type
boolean

loggedIn() → {boolean}

Returns whether user is logged in

Source:
Returns
Type
boolean

registered() → {boolean}

Returns whether user is registered

Source:
Returns
Type
boolean

viaExternalProvider() → {boolean}

Returns whether user is logged in via a third party

Source:
Returns
Type
boolean

(inner) initialize()

Marshalls data from BauplanData

Alternatively, checks for presence of cookie

Source:

(inner) setRegisteredCookie()

Source:

Events

change:loggedIn

When user logs in or out

Source:
Listeners of This Event

change:registered

When user has succesfully registered

Source:
Listeners of This Event