All files utils.ts

100% Statements 4/4
100% Branches 0/0
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25  1x                 1x 3x                     3x    
import { RequestHandler } from 'express';
import session from 'express-session';
import { Application } from '@feathersjs/feathers';
 
export interface OauthSetupSettings {
  authService: string;
  linkStrategy: string;
  expressSession: RequestHandler;
}
 
export const getDefaultSettings = (app: Application, other?: Partial<OauthSetupSettings>) => {
  const defaults: OauthSetupSettings = {
    authService: app.get('defaultAuthentication'),
    linkStrategy: 'jwt',
    expressSession: session({
      secret: Math.random().toString(36).substring(7),
      saveUninitialized: true,
      resave: true
    }),
    ...other
  };
 
  return defaults;
};