Skip to content

Conversation

@jigar-f
Copy link
Contributor

@jigar-f jigar-f commented Jan 7, 2026

This pull request introduces support for staging environments in the API client. The changes ensure that when the application is running in a staging environment, it will connect to the appropriate staging servers for both authentication and pro services. This is achieved by adding new staging URLs and logic to switch endpoints based on the environment, as well as updating relevant methods to use these staging URLs when necessary.

Environment and Endpoint Selection:

  • Added a new Stage() function in common/init.go to detect if the application is running in a staging environment.
  • Introduced new constants stageURL and stageProServerURL for the staging authentication and pro service endpoints in api/user.go and api/subscription.go. [1] [2]

API Client Initialization:

  • Updated NewAPIClient in api/api.go to switch to the staging pro server and authentication server URLs if the environment is staging, with appropriate log messages. [1] [2]

OAuth Flow:

  • Modified the OAuthLoginUrl method in api/user.go to use the staging authentication server URL when in a staging environment.

Imports:

  • Added import of the common package in api/user.go to access the new Stage() function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants