feat: WIP, admins only can see a table of users that have logged in the site

This commit is contained in:
2023-01-10 02:16:20 +01:00
parent 2901a1f899
commit af2fcc31f8
4 changed files with 100 additions and 3 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ import { Router } from 'express'
import { AuthorizationCode } from 'simple-oauth2'
import fetch from 'node-fetch'
export function setupOauth(r: Router) {
export function setupOAuth(r: Router) {
const config = {
client: {
id: process.env.OAUTH_CLIENT_ID ?? '',
+2 -2
View File
@@ -38,7 +38,7 @@ import {
import { initialDatabaseValue } from './db/example-data'
import { validateObjectKeys } from '../shared/utils'
import { setupOauth } from './auth'
import { setupOAuth } from './auth'
export async function createApiRouter() {
type SessionId = Opaque<string, string, 'session'>
@@ -73,7 +73,7 @@ export async function createApiRouter() {
const authRouter: Router = express.Router()
setupOauth(authRouter)
setupOAuth(authRouter)
r.use('/auth', authRouter)
r.get('/api/status', (req, res) => {