Files
sdk-server-stubs/src/routes.ts
T

27 lines
976 B
TypeScript

import {
SDKConfig
} from './config';
import express from 'express';
export const routes = ( app: express.Application, configuration: SDKConfig ) => {
app.get( '/jhid/v2/verify/full/sdk', ( _request: express.Request, response: express.Response ) => {
response.send( 'ok' );
} );
app.get( '/jhid/v2/verify/simple', ( _request: express.Request, response: express.Response ) => {
response.send( 'ok' );
} );
app.get( '/jhid/v2/login', ( _request: express.Request, response: express.Response ) => {
response.redirect( ( configuration.frontendURL ?? '' ) + ( configuration.defaultRedirectURL ?? '/account' ) );
} );
app.get( '/jhid/v2/logout', ( _request: express.Request, response: express.Response ) => {
response.redirect( configuration.frontendURL ?? '/' );
} );
app.get( '/jhid/v2/check/cors', ( request: express.Request, response: express.Response ) => {
response.send( 'ok' );
} );
};