Skip to content

Commit

Permalink
shop and admin panel
Browse files Browse the repository at this point in the history
  • Loading branch information
NebraskyTheWolf committed Jan 27, 2024
1 parent f8c08ba commit 00c77c4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/api/Server/AbstractWebRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ export default abstract class AbstractWebRoutes extends Base {
}
}

export const router = express.Router()
export var router = express.Router()
10 changes: 2 additions & 8 deletions src/api/website/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,15 @@ export default class WebsiteServer {
next();
});

this.passport.init(app)

// Rotating secret if there is no secret set
app.use(cookieParser(process.env.COOKIE_SECRET))

this.server = http.createServer(app)
app.use(parser.json())

app.use(`/`, new Index().routing())
app.use(`/auth`, new Auth().routing())
app.use(`/profile`, new Profile().routing())
app.use(`/servers`, new Server().routing())
app.use(`/admin`, new Admin().routing())
app.use(`/dashboard`, new Dashboard().routing())
app.use(`/shop`, new Shop().routing())
app.use(`/admin`, new Admin().routing())
app.use(`/auth`, new Auth().routing())

Riniya.instance.logger.info('The website is operational.')
}
Expand Down
3 changes: 2 additions & 1 deletion src/api/website/passport/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Express } from 'express'
import express, { Express } from 'express'
import DiscordPassport from "passport-discord";
import Refresh from "passport-oauth2-refresh";
import passport from "passport";
Expand All @@ -23,6 +23,7 @@ export interface IUser {
export default class Passport {
public init(app: Express) {
app.use(passport.initialize())
app.use(passport.session())

const discordStrategy = new DiscordPassport.Strategy({
clientID: process.env["DISCORD_CLIENT_ID"],
Expand Down

0 comments on commit 00c77c4

Please sign in to comment.