Add dashboard frontend
This commit is contained in:
@@ -260,6 +260,7 @@ const createDashboardApp = () => {
|
||||
const app = express();
|
||||
|
||||
app.use(express.json());
|
||||
app.use(express.static(path.join(__dirname, 'public')));
|
||||
|
||||
app.get('/auth/discord', (req, res) => {
|
||||
if (!ensureOAuthConfig()) {
|
||||
@@ -313,6 +314,10 @@ const createDashboardApp = () => {
|
||||
return res.redirect(DASHBOARD_CLIENT_URL);
|
||||
}
|
||||
|
||||
if (req.accepts('html')) {
|
||||
return res.redirect('/');
|
||||
}
|
||||
|
||||
return res.status(200).json({ user });
|
||||
} catch (error) {
|
||||
return res.status(502).json({ error: 'Failed to authenticate with Discord' });
|
||||
|
||||
Reference in New Issue
Block a user