FreedomBen / libmalan

Simple TypeScript utility methods for accessing the Malan authentication service
MIT License
0 stars 1 forks source link

Add extension API #34

Closed FreedomBen closed 1 year ago

FreedomBen commented 1 year ago

Session can now be extended in Malan. This adds support for that, with two changes:

  1. Added new (optional) params to the session create (login) function. These can be used to configure what is allowed for extensions on the function. Parameters are:

    max_extension_secs: The maximum number of seconds into the future that sessions can be extended to at any given time. extendable_until_seconds: The absolute latest the token will be valid. No extensions can take the token life beyond this point. The max point is calculated at session creation time by adding this parameter to the current time.

  2. Added new function session.extend(..) that can be used to extend a token. This takes one (optional) parameter expireInSeconds that includes the number of seconds into the future that the token should now be valid

FreedomBen commented 1 year ago

Note, this might change slightly as the server-side changes aren't finalized.