-
Notifications
You must be signed in to change notification settings - Fork 2
use useProfile instead of user #889
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
Open
ghazwarhili
wants to merge
11
commits into
main
Choose a base branch
from
cleanup-apache-config-requests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
04caa4f
use useProfile instead of user
ghazwarhili 189bc0a
use user profile
ghazwarhili 86e824b
Avoid booting the full app inside the OIDC silent-renew iframe
ghazwarhili de37c38
revert
ghazwarhili be7b125
Merge branch 'main' into cleanup-apache-config-requests
ghazwarhili 355d9d2
resolve conflicts
ghazwarhili de04fbd
code review remarks
ghazwarhili 17c16b3
code review remarks
ghazwarhili 1e8078d
Revert "code review remarks"
ghazwarhili dfd3871
upgrade commons-ui version
ghazwarhili 4a3387f
fix sonar issue
ghazwarhili File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /** | ||
| * Copyright (c) 2026, RTE (http://www.rte-france.com) | ||
| * This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
| */ | ||
| import { useCallback, useEffect, useState } from 'react'; | ||
| import type { UserManager } from 'oidc-client-ts'; | ||
| import { | ||
| handleSilentRenewCallback, | ||
| initializeAuthenticationProd, | ||
| SilentRenewCallbackHandler, | ||
| } from '@gridsuite/commons-ui'; | ||
| import { getCachedIdpSettings } from '../utils/rest-api'; | ||
|
|
||
| export default function SilentRenewApp() { | ||
| const [userManager, setUserManager] = useState<UserManager | null>(null); | ||
|
|
||
| useEffect(() => { | ||
| initializeAuthenticationProd( | ||
| () => undefined /* dispatch: unused when isSilentRenew=true */, | ||
| true /* isSilentRenew */, | ||
| getCachedIdpSettings /* reads the cache instead of fetching idpSettings.json */, | ||
| false /* isSigningCallback */ | ||
| ) | ||
| .then(setUserManager) | ||
| .catch((e) => console.error('Silent renew init failed:', e)); | ||
| }, []); | ||
|
|
||
| const handleSilentRenewCallbackClosure = useCallback(() => { | ||
| if (userManager) { | ||
| handleSilentRenewCallback(userManager); | ||
| } | ||
| }, [userManager]); | ||
|
|
||
| return ( | ||
| <SilentRenewCallbackHandler | ||
| userManager={userManager} | ||
| handleSilentRenewCallback={handleSilentRenewCallbackClosure} | ||
| /> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.