more auth stuff

This commit is contained in:
ntr committed 2022-08-08 22:58:19 +10:00
1 parent 65e603f222
commit a8e5e5d7cd
7 files changed
+98 -53

No files matched your search

+2 -6
View File
@@ -108,7 +108,7 @@ export default function createApi(log: Log, pg: Pg, discogs) {
app.use(bodyParser())
app.keys = [SECRET];
app.use(session({ sameSite: 'None' }, app));
app.use(session(app));
const { authRouter, passport } = routerAuth(log, pg);
app.use(passport.initialize());
@@ -119,11 +119,7 @@ export default function createApi(log: Log, pg: Pg, discogs) {
ctx.status = 200;
});
async function requireAuth(ctx, next) {
await next();
}
router.get('/bundles', requireAuth, async (ctx, next) => {
router.get('/bundles', async (ctx, next) => {
const bundles = await getBundles();
ctx.response.body = bundles;
})