Skip to content

feat: implementation of logout functionality#838

Open
Akhileswara-Microsoft wants to merge 9 commits intodevfrom
LogoutFunctionality_Akhileswar
Open

feat: implementation of logout functionality#838
Akhileswara-Microsoft wants to merge 9 commits intodevfrom
LogoutFunctionality_Akhileswar

Conversation

@Akhileswara-Microsoft
Copy link
Copy Markdown
Contributor

@Akhileswara-Microsoft Akhileswara-Microsoft commented May 6, 2026

Purpose

This pull request refactors how user authentication and profile information are handled in the app header. The user avatar and login/logout functionality are now encapsulated in a new LoginButton component, which provides a user menu and displays the user's name and email. Additionally, user email is now fetched and stored in the Redux state, and the header code has been simplified as a result.

These changes make the app header more modular and user-friendly, and improve robustness and clarity in handling user authentication data.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Azure Easy Auth–backed authentication state to the React frontend and updates the header UI to show a user avatar with a sign-out menu.

Changes:

  • Introduces an AuthContext (AuthProvider + useAuth) that reads user claims from /.auth/me and exposes login/logout redirects.
  • Adds a LoginButton component that renders an avatar-based menu with a “Sign out” action.
  • Wraps the app in AuthProvider and swaps the header avatar for the new component.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
src/App/src/main.tsx Wraps the app with AuthProvider so auth state is available globally.
src/App/src/contexts/AuthContext.tsx New context for Easy Auth user loading + login/logout redirects.
src/App/src/components/LoginButton.tsx New header avatar/menu UI for user display and sign-out.
src/App/src/components/AppHeader.tsx Replaces the previous Avatar with LoginButton.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/App/src/components/AppHeader.tsx
Comment thread src/App/src/contexts/AuthContext.tsx Outdated
Comment thread src/App/src/contexts/AuthContext.tsx Outdated
Comment thread src/App/src/components/LoginButton.tsx
Comment thread src/App/src/components/LoginButton.tsx Outdated
Comment thread src/App/src/components/LoginButton.tsx
Copilot AI review requested due to automatic review settings May 6, 2026 07:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

Comment thread src/App/src/store/appSlice.ts Outdated
Comment thread src/App/src/components/LoginButton.tsx Outdated
Comment thread src/App/src/components/LoginButton.tsx
Comment thread src/App/src/components/LoginButton.tsx
Comment thread src/App/src/App.tsx
…-label on LoginButton buttons

Agent-Logs-Url: https://github.com/microsoft/content-generation-solution-accelerator/sessions/22315c19-138c-49fc-9d54-060a30972272

Co-authored-by: Akhileswara-Microsoft <234037885+Akhileswara-Microsoft@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 6, 2026 08:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread src/App/src/components/LoginButton.tsx Outdated
Comment thread src/App/src/components/LoginButton.tsx
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.

3 participants