0.3.12 • Published 4 months ago

@aleph-alpha/lib-auth v0.3.12

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

Aleph Alpha Lib Auth

@aleph-alpha/lib-auth

This project provides an adaptation of oidc-client-ts with some guards you could use on vur-router or another routing of your preference.

npm install @aleph-alpha/lib-auth
pnpm add @aleph-alpha/lib-auth

Example setup for AuthManager

import { createAuthManager } from '@aleph-alpha/lib-auth'

export default createAuthManager(
    'issuer',
    'clientId',
    'http:localhost:5173',
    '/callback',
);

Example for Vue-Router with Guards

import authManager from 'your-path/auth';
import { guardForEntryPage, guardForCallbackPage } from '@aleph-alpha/lib-auth'

const routes = {
    path: '/',
    name: 'Home',
    beforeEnter: (to, from, next) => {
      guardForEntryPage(authManager, () => next());
    },
  },
  {
    path: '/callback',
    name: 'LoginCallback',
    beforeEnter: (to, from, next) => {
      guardForCallbackPage(authManager, () => next());
    },
  },
0.3.12

4 months ago

0.3.11

5 months ago

0.3.10

5 months ago

0.3.9

5 months ago

0.3.8

5 months ago

0.3.7

5 months ago

0.3.6

5 months ago

0.3.5

6 months ago

0.3.4

6 months ago

0.3.3

6 months ago

0.3.2

7 months ago

0.3.1

7 months ago

0.3.0

7 months ago

0.2.400

7 months ago