1.0.6 • Published 9 months ago

@faable/auth-helpers-fastify v1.0.6

Weekly downloads
-
License
-
Repository
github
Last release
9 months ago

Install

 npm install @faable/auth-helpers-fastify

Usage

Register the plugin in your Fastify instance.

import faableAuthPlugin from "@faable/auth-helpers-fastify";

...

// Register FaableAuth
fastify.register(faableAuthPlugin,{
    domain:"https://<team>.auth.faable.com"
});

Then you can check access in an endpoint running faableAuth() hook.

fastify.post("/", { preHandler: app.faableAuth() }, (req, res) => {
  return res.send("Access Granted");
});

Options

Plugin OptionsDescriptionDefault
domainVerify issuer of jwt token. Set your FaableAuth domain here.''
Verify OptionsDescriptionDefault
requiredUser is requiredtrue
scopesCheck JWT scope claim has permissions defined in this array[]

Env vars

EnvironmentDescription
FAABLEAUTH_CLIENT_IDApp Client ID
FAABLEAUTH_CLIENT_SECRETApp Client Secret
FAABLEAUTH_DOMAINCan be used instead of domain option
1.0.6

9 months ago

1.0.5

10 months ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago