0.3.12 • Published 9 months ago

@aleph-alpha/lib-auth v0.3.12

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

9 months ago

0.3.11

9 months ago

0.3.10

9 months ago

0.3.9

9 months ago

0.3.8

9 months ago

0.3.7

9 months ago

0.3.6

10 months ago

0.3.5

10 months ago

0.3.4

10 months ago

0.3.3

10 months ago

0.3.2

12 months ago

0.3.1

12 months ago

0.3.0

12 months ago

0.2.400

12 months ago