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

Show username on the header #5172

Merged
merged 2 commits into from
Sep 2, 2024
Merged

Show username on the header #5172

merged 2 commits into from
Sep 2, 2024

Conversation

t-kikuc
Copy link
Member

@t-kikuc t-kikuc commented Sep 2, 2024

What this PR does / why we need it:

As title.
Since avatar images are not shown on the header for OIDC users, users want to know which account they logged in to.

  • GitHub: GitHub user ID

    image
  • OIDC: username from IdP

    image

I think role is not necessary to show.

Which issue(s) this PR fixes:

Related to #5008

See #5008 (comment)

Does this PR introduce a user-facing change?: Users can see their username.

  • How are users affected by this change: N/A
  • Is this breaking change: no
  • How to migrate (if breaking change): no

For Reviewers

See here to understand why subject is used.

user, err := getUser(ctx, sso, proj, authCode)
if err != nil {
h.handleError(w, r, "Unable to find user", err)
return
}
claims := jwt.NewClaims(
user.Username,
user.AvatarUrl,
tokenTTL,
*user.Role,
)

Copy link

codecov bot commented Sep 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 22.88%. Comparing base (a61c397) to head (e61eba5).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5172      +/-   ##
==========================================
- Coverage   22.90%   22.88%   -0.03%     
==========================================
  Files         416      416              
  Lines       44598    44598              
==========================================
- Hits        10216    10206      -10     
- Misses      33592    33601       +9     
- Partials      790      791       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

👍🏻

Copy link
Member

@ffjlabo ffjlabo left a comment

Choose a reason for hiding this comment

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

🚀

@t-kikuc t-kikuc merged commit a295485 into master Sep 2, 2024
16 of 17 checks passed
@t-kikuc t-kikuc deleted the ui-show-username branch September 2, 2024 09:53
This was referenced Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants