3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Simplify dev docker setup

This commit is contained in:
Dragory 2022-06-26 19:30:46 +03:00
parent b655085115
commit ce2255b6b7
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
13 changed files with 65 additions and 97 deletions

View file

@ -88,7 +88,7 @@ export function initAuth(app: express.Express) {
tokenURL: "https://discord.com/api/oauth2/token",
clientID: env.CLIENT_ID,
clientSecret: env.CLIENT_SECRET,
callbackURL: env.OAUTH_CALLBACK_URL,
callbackURL: `${env.API_URL}/auth/oauth-callback`,
scope: ["identify"],
},
async (accessToken, refreshToken, profile, cb) => {
@ -117,9 +117,9 @@ export function initAuth(app: express.Express) {
passport.authenticate("oauth2", { failureRedirect: "/", session: false }),
(req: Request, res: Response) => {
if (req.user && req.user.apiKey) {
res.redirect(`https://${env.DASHBOARD_DOMAIN}/login-callback/?apiKey=${req.user.apiKey}`);
res.redirect(`${env.DASHBOARD_URL}/login-callback/?apiKey=${req.user.apiKey}`);
} else {
res.redirect(`https://${env.DASHBOARD_DOMAIN}/login-callback/?error=noAccess`);
res.redirect(`${env.DASHBOARD_URL}/login-callback/?error=noAccess`);
}
},
);