0.3.12 • Published 6 months ago

@aleph-alpha/lib-auth v0.3.12

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
6 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

6 months ago

0.3.11

6 months ago

0.3.10

6 months ago

0.3.9

6 months ago

0.3.8

6 months ago

0.3.7

7 months ago

0.3.6

7 months ago

0.3.5

7 months ago

0.3.4

7 months ago

0.3.3

7 months ago

0.3.2

9 months ago

0.3.1

9 months ago

0.3.0

9 months ago

0.2.400

9 months ago