3.1.0 • Published 4 months ago

frau-jwt v3.1.0

Weekly downloads
711
License
Apache-2.0
Repository
github
Last release
4 months ago

frau-jwt

NPM version

Simple utility to get a json web token in a D2L free range application (frau).

Install

npm install frau-jwt --save

Usage

import jwt from 'frau-jwt';

const token = await jwt('a:b:c');

API


jwt([String scope][, Object opts]) -> Promise<String>

Requests a JWT with the given scope and opts from the hosting LMS. If in an ifrau, the request will be delegated to the frame host.

The resulting token will be cached until it expires.

scope String (*:*:*:)

If scope is provided, then it will be sent as the request scope of the token. It should be a properly formatted String, with scopes seperated by spaces.

jwt();
jwt('foo:bar:baz');
jwt('a:b:c x:y:z');
opts Object

If an opts object is provided, the following options will be checked for:

Option: extendSession Boolean (true)

You may optionally specify whether you want the user's sessions to be extended by the act of fetching the token.

jwt();
jwt({ extendSession: false });
jwt('foo:bar:baz', { extendSession: false });

Testing

npm test

Versioning and Releasing

This repo is configured to use semantic-release. Commits prefixed with fix: and feat: will trigger patch and minor releases when merged to main.

To learn how to create major releases and release from maintenance branches, refer to the semantic-release GitHub Action documentation.

3.1.0

4 months ago

3.0.2

7 months ago

3.0.1

2 years ago

3.0.0

2 years ago

2.3.0

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.0

3 years ago

2.0.5

4 years ago

2.0.6

4 years ago

2.0.4

4 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago