Skip to content

Commit

Permalink
fix(landing): fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ncarlier committed Jun 5, 2022
1 parent 82fdcd7 commit a04ed26
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 32 deletions.
14 changes: 3 additions & 11 deletions landing/config/api.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
const endpoint = process.env.READFLOW_ENDPOINT || 'https://api.readflow.app'
const clientID = process.env.READFLOW_CLIENT_ID || 'subscription-management'
const clientSecret = process.env.READFLOW_CLIENT_SECRET

const config = {
endpoint,
clientID,
clientSecret
}

export default config
export const endpoint = process.env.READFLOW_ENDPOINT || 'https://api.readflow.app'
export const clientID = process.env.READFLOW_CLIENT_ID || 'subscription-management'
export const clientSecret = process.env.READFLOW_CLIENT_SECRET
6 changes: 3 additions & 3 deletions landing/config/oidc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

export const authority = process.env.NEXT_PUBLIC_AUTHORITY || 'https://login.readflow.app/auth/realms/readflow'
const clientId = process.env.NEXT_PUBLIC_CLIENT_ID || 'about.readflow.app'
const redirectUri = process.env.NODE_ENV === "development" ? "http://localhost:3000/" : "https://about.readflow.app"
const redirectUri = process.env.NODE_ENV === 'development' ? 'http://localhost:3000/' : 'https://about.readflow.app'

const config = {
onSignIn: async (user) => {
console.log(`logged user: ${user}`)
},
authority,
clientId,
responseType: "id_token",
scope: "openid profile",
responseType: 'id_token',
scope: 'openid profile',
autoSignIn: false,
redirectUri
}
Expand Down
11 changes: 2 additions & 9 deletions landing/config/sendmail.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
const serviceURL = process.env.SENDMAIL_SERVICE_URL
const contactMail = process.env.SENDMAIL_CONTACT_MAIL

const config = {
serviceURL,
contactMail,
}

export default config
export const serviceURL = process.env.SENDMAIL_SERVICE_URL
export const contactMail = process.env.SENDMAIL_CONTACT_MAIL
8 changes: 1 addition & 7 deletions landing/config/site.js
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
const baseURL = process.env.NODE_ENV === "development" ? "http://localhost:3000" : "https://about.readflow.app"

const config = {
baseURL,
}

export default config
export const baseURL = process.env.NODE_ENV === 'development' ? 'http://localhost:3000' : 'https://about.readflow.app'
2 changes: 1 addition & 1 deletion landing/helpers/readflow.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import api from '@/config/api'
import * as api from '@/config/api'
import oidcConfig from '@/config/oidc'

const getRegisterUserMutation = (username) => `
Expand Down
2 changes: 1 addition & 1 deletion landing/helpers/token.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import jwt_decode from "jwt-decode"
import jwt_decode from 'jwt-decode'

/**
* Decode JSON Web Token.
Expand Down

0 comments on commit a04ed26

Please sign in to comment.