UX: Improve user API key authorization page (#36777)

The authorization page shown when third-party applications request API
access was bare-bones and lacked important context for users to make
informed decisions.

This commit redesigns the page to include:
- Clear title with quoted application name
- Current user indicator (avatar + username)
- Permissions section showing what access is being granted
- Redirect destination displayed prominently

These changes help users better understand what they're authorizing and
where they'll be redirected after approval.

Internal ref - t/171051

**BEFORE**

<img width="1156" height="1012" alt="CleanShot 2025-12-18 at 16 17 05"
src="https://github.com/user-attachments/assets/62a14e36-5ad4-425a-8f56-9723e22bc509"
/>

**AFTER**

<img width="1445" height="1138" alt="2025-12-18 @ 17 17 43"
src="https://github.com/user-attachments/assets/9408c7f5-dbc8-4290-87ec-b88679f75f99"
/>
This commit is contained in:
Régis Hanol
2025-12-23 22:20:35 +01:00
committed by GitHub
parent 8f871bef2d
commit bad1cd9dee
6 changed files with 104 additions and 34 deletions
@@ -44,6 +44,12 @@ class UserApiKeysController < ApplicationController
@nonce = params[:nonce]
@client_id = params[:client_id]
@auth_redirect = params[:auth_redirect]
@redirect_uri =
begin
URI.parse(@auth_redirect)
rescue StandardError
nil
end if @auth_redirect.present?
@push_url = params[:push_url]
@localized_scopes = params[:scopes].split(",").map { |s| I18n.t("user_api_key.scopes.#{s}") }
@scopes = params[:scopes]