0.0.22 • Published 1 year ago

@sgftech/passport-saasform v0.0.22

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

passport-saasform

Passport strategy for authenticating via external server.

Tested on Node.js and serverless applications, Firebase Functions, AWS Lambda.

With Saasform you can separate user authentication and management from your core application. All user flows like registration, login, password reset, inviting other users to an account, etc. are handled by Saasform. When a user is signed in, Saasform issues a JWT token and redirects the user to your application. This Passport strategy helps you validate Saasform's token with ease.

Install

npm install passport-saasform

or

yarn add passport-saasform

Usage

Here's a minimal working example:

const express = require('express');
const app = express();

const passport = require('passport');
const SaasformStrategy = require('passport-saasform');

passport.use(new SaasformStrategy({
  // saasformUrl: 'https://beautifulsaas.com',
  // appBaseUrl: 'https://app.beautifulsaas.com',
}));

const auth = passport.authenticate('saasform', { session: false });

app.get('/', auth, (req, res) => {
  res.send(`Hello ${req.user.email}!`);
});

const port = 3000;
app.listen(port, () => {
  console.log(`Ready: http://localhost:${port}/`);
});

Contribute

We welcome any type of contribution: code, bugs, feature requests... Oh, and tests!

0.0.22

1 year ago

0.0.21

1 year ago

0.0.20

1 year ago

0.0.19

2 years ago

1.0.0

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago