Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Auth2 token generation and new fetching with tokens for the orgchart #3

Open
wants to merge 3 commits into
base: choreo
Choose a base branch
from

Conversation

vish-mv
Copy link

@vish-mv vish-mv commented Sep 20, 2024

Purpose

Fix frontend to handle auth 2 requests before calling endpoints secured with auth2

Changes

  • Add token generation via choreo managed authentication (client_credentials)
  • Add Error handling for invalid token. (invalid credentials)
  • Update api calls with new Auth header

src/App.js Outdated

async function getAccessToken() {
const tokenEndpoint = window?.configs?.tokenEndpoint ? window.configs.tokenEndpoint : "/";
const clientId = window?.configs?.clientId ? window.configs.clientId : "id";;

Choose a reason for hiding this comment

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

redundant semi colons

Copy link
Author

Choose a reason for hiding this comment

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

fixed here

}, []);

async function getAccessToken() {
const tokenEndpoint = window?.configs?.tokenEndpoint ? window.configs.tokenEndpoint : "/";

Choose a reason for hiding this comment

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

Add comments for readability. Explain what these configs are for

Copy link
Author

Choose a reason for hiding this comment

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

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