Skip to content

Commit

Permalink
fix: correct env for oauth callback
Browse files Browse the repository at this point in the history
  • Loading branch information
rawkode committed Jul 20, 2023
1 parent 3a571e0 commit 0a3ca5d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 4 additions & 0 deletions projects/rawkode.academy/cms/nodemon.json
@@ -0,0 +1,4 @@
{
"exec": "ts-node src/server.ts",
"ext": "ts"
}
11 changes: 3 additions & 8 deletions projects/rawkode.academy/cms/src/payload.config.ts
Expand Up @@ -39,17 +39,12 @@ export default buildConfig({
},
plugins: [
oAuthPlugin({
clientID: process.env.APPSETTING_OAUTH_CLIENT_ID || "",
clientSecret: process.env.APPSETTING_OAUTH_CLIENT_SECRET || "",
clientID: process.env.APPSETTING_OAUTH_CLIENT_ID,
clientSecret: process.env.APPSETTING_OAUTH_CLIENT_SECRET,
authorizationURL: `${process.env.APPSETTING_OAUTH_BASE_URL}/login/oauth/authorize`,
tokenURL: `${process.env.APPSETTING_OAUTH_BASE_URL}/login/oauth/access_token`,
callbackURL: `${
process.env.APPSETTING_DNS_NAME || "https://localhost:3000"
}/oauth2/callback`,
callbackURL: `${process.env.APPSETTING_DNS_NAME}/oauth2/callback`,
scope: "basic",
// This needs to be set, but setting it to anything other
// than an empty string will cause it to try and connect
// to the database during build
mongoUrl: process.env.APPSETTING_MONGODB_URI,
userCollection: {
slug: People.slug,
Expand Down
4 changes: 2 additions & 2 deletions projects/rawkode.academy/cms/src/server.ts
Expand Up @@ -12,8 +12,8 @@ const start = async () => {
console.debug(process.env);

await payload.init({
secret: process.env.APPSETTING_PAYLOAD_SECRET || "help-me",
mongoURL: process.env.APPSETTING_MONGODB_URI || "mongodb://127.0.0.1:27017",
secret: process.env.APPSETTING_PAYLOAD_SECRET,
mongoURL: process.env.APPSETTING_MONGODB_URI,
express: app,
onInit: async () => {
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`);
Expand Down

0 comments on commit 0a3ca5d

Please sign in to comment.