Files
auth/src/testing.ts
T

36 lines
768 B
TypeScript

import {
addRoutes,
ensureAuth
} from './index.js';
import express from 'express';
const app = express();
addRoutes( app, {
'oidc': {
'clientID': process.env.CLIENT_ID ?? '',
'clientSecret': process.env.CLIENT_SECRET ?? '',
'issuer': new URL( 'https://home.janishutz.com/oidc' )
},
'app': {
'sessionSecret': 'secret',
'url': new URL( 'https://home2.janishutz.com' ),
'successRedirect': '/account'
},
'prod': false
}, async uid => {
console.log( uid );
return true;
} );
app.get( '/', ( _request, response ) => {
response.send( 'Hello World' );
} );
app.get( '/account', ensureAuth( '/' ), ( _request, response ) => {
response.send( 'Account' );
} );
app.listen( 8080 );