more auth stuff
This commit is contained in:
1 parent
65e603f222
commit
a8e5e5d7cd
7 files changed
+98
-53
No files matched your search
+2
-6
@@ -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;
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user