Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import msal, { LogLevel } from '@azure/msal-node'
import { Injectable } from '@nestjs/common'
import { ConfigService } from '@nestjs/config'
import { NEST_API_URL } from '@talent-connect/shared-config'
import { EntraIdLoginOptions } from './entra-id-login-options.interface'

@Injectable()
Expand All @@ -11,7 +12,7 @@ export class EntraIdConfigProvider {
constructor(configService: ConfigService) {
this.options = {
scopes: [],
redirectUri: configService.get<string>('NX_NESTJS_API_URI') + '/auth/entra-redirect', // to backend
redirectUri: `${NEST_API_URL}/api/auth/entra-redirect`, // to backend
successRedirect: configService.get<string>('NX_FRONTEND_URI') + '/front/login/entra-login', // to frontend
cloudInstance: configService.get<string>('NX_ENTRA_ID_CLOUD_INSTANCE'),
}
Expand Down
2 changes: 1 addition & 1 deletion apps/redi-connect/src/routes/routes__logged-out.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const routes__loggedOut: RouteDefinition[] = [
{
path: '/front/login/entra-redirect',
component: () => {
window.location.href = `${NEST_API_URL}/auth/entra-id`
window.location.href = `${NEST_API_URL}/api/auth/entra-id`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuartmclean What's the reason for this change? Is it a common practice to set a URL on the browser to what seems to be an API URL?

@stuartmclean stuartmclean Jan 23, 2024

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @helloanil This is a bit of a hack, I agree, but it doesn't actually display anything to the user and it's the only way I could make this work without setting up a whole different root url just for this one endpoint. Happy to hear other suggestions though. 😎

return null
},
exact: true,
Expand Down
2 changes: 1 addition & 1 deletion libs/data-access/src/lib/graphql-client.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NEST_API_URL } from '@talent-connect/shared-config'
import { GraphQLClient } from 'graphql-request'

export const graphqlClient = new GraphQLClient(NEST_API_URL, {
export const graphqlClient = new GraphQLClient(`${NEST_API_URL}/graphql`, {
// headers: {
// authorization: 'Bearer MY_TOKEN',
// },
Expand Down
4 changes: 2 additions & 2 deletions libs/shared-config/src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ export const MENTORSHIP_MATCH_STATUS_LABELS: any = {
}

export const NEST_API_URL = process.env.NODE_ENV === 'production'
? 'https://connect-nestjs-api.redi-school.org/graphql'
: 'http://localhost:3333/graphql'
? 'https://connect-nestjs-api.redi-school.org'
: 'http://localhost:3333'
export const API_URL = process.env.NX_API_URL
? process.env.NX_API_URL
: 'http://localhost:3003/api'
Expand Down