Move in progress apps temporarily

This commit is contained in:
Darren Clarke 2023-03-07 14:09:49 +00:00
parent ba04aa108c
commit 6eaaf8e9be
360 changed files with 6171 additions and 55 deletions

View file

@ -1,26 +0,0 @@
import type * as Hapi from "@hapi/hapi";
import NextAuthPlugin, { AdapterFactory } from "@digiresilience/hapi-nextauth";
import { NextAuthAdapter } from "common";
import type { SavedUser, UnsavedUser, SavedSession } from "common";
import { IAppConfig } from "config";
export const registerNextAuth = async (
server: Hapi.Server,
config: IAppConfig
): Promise<void> => {
// I'm not sure why I need to be so explicit with the generic types here
// I thought ts could figure out the generics based on the concrete params, but apparently not
const nextAuthAdapterFactory: AdapterFactory<
SavedUser,
UnsavedUser,
SavedSession
> = (request: Hapi.Request) => new NextAuthAdapter(request.db());
await server.register({
plugin: NextAuthPlugin,
options: {
nextAuthAdapterFactory,
sharedSecret: config.nextAuth.secret,
},
});
};