Class: LoginTransitionObject

LoginTransitionObject()

Add fields for login transtion objects

Adds these fields: _t_u_key,user_key, `strategy'

The strategy defaults to ucwid and distributed ID ucwid is a kind of cwid. This indicates to some login processor that the particular kind of ID will be used to identify a user. Applications may use other strategies or several. This type merely provides the placeholder.

In copious-transition-applications, the field _t_u_key is used to identify which JSON field of some object, such as a web app POST parameters will be contain the information to be stored in the user_key, which itself may eventually be a key into some DB. The key, _db_session_key provides a similar function and is often the same as _t_u_key.

Constructor

new LoginTransitionObject()

Source:

Extends

Methods

add_extra_field(fld)

The fields returned from to_object are by default just a few provided by the base classs. For TransitionObject these are just the following: "token", "secondary_action", "session_token", "type" Use this method to add more field to be included in the to_object report.

Parameters:
Name Type Description
fld string
Overrides:
Source:

add_extra_fields(fld_list)

Call add_extra_field for each member of the fld_list parameter.

Parameters:
Name Type Description
fld_list Array.<string>
Overrides:
Source:

add_to_elements(obj)

Extend the elements object with more fields and info. These may overwrite existing fields.

Parameters:
Name Type Description
obj object
Overrides:
Source:

clear_session(token)

If this token has been assigned to a session, then erase the session identifier and replace it with a message of abandonment, 'sess+gone'.

Parameters:
Name Type Description
token string
Overrides:
Source:

set_session(sess_id)

Set the session id with the expectation that this assertion declares that the token belong to a session.

Parameters:
Name Type Description
sess_id string
Overrides:
Source:

set_token(token)

Fix the token of this object.

Parameters:
Name Type Description
token string
Overrides:
Source:

to_object(extrasopt) → {object}

Returns an object without class information containing a minimal set of top level fields refering to current values. If the extras parameter is supplied, this method assumes that it is an array of field names. The extra field will be added to the object produced by this method.

Parameters:
Name Type Attributes Description
extras Array.<string> <optional>
Overrides:
Source:
Returns:
Type
object