Compare commits

..

7 Commits

Author SHA1 Message Date
Stavros
34c035e855 fix: omit empty user info values 2026-03-02 16:00:24 +02:00
Stavros
fcc56b2ce5 feat: add user info claims to id token 2026-03-02 15:30:18 +02:00
Stavros
0354c9a122 chore: update screenshot 2026-03-01 13:52:27 +02:00
Stavros
4bed73d0fb refactor: pass all search params to correct domain in domain warning 2026-03-01 13:42:52 +02:00
Stavros
d0e39c6149 refactor: card title and layout tweaks (#675)
* refactor: card title and layout tweaks

* chore: review comments

* refactor: update domain warning screen
2026-03-01 13:36:43 +02:00
Stavros
89da4028bb New Crowdin updates (#674)
* New translations en.json (French)

* New translations en.json (Ukrainian)
2026-02-28 15:02:16 +02:00
dependabot[bot]
c8462f1bdf chore(deps-dev): bump @types/node in /frontend in the minor-patch group (#673)
Bumps the minor-patch group in /frontend with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 25.3.1 to 25.3.2
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 25.3.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: minor-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-28 15:00:35 +02:00
7 changed files with 59 additions and 40 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 MiB

After

Width:  |  Height:  |  Size: 3.6 MiB

View File

@@ -37,7 +37,7 @@
"devDependencies": { "devDependencies": {
"@eslint/js": "^10.0.1", "@eslint/js": "^10.0.1",
"@tanstack/eslint-plugin-query": "^5.91.4", "@tanstack/eslint-plugin-query": "^5.91.4",
"@types/node": "^25.3.1", "@types/node": "^25.3.2",
"@types/react": "^19.2.14", "@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3", "@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.4", "@vitejs/plugin-react": "^5.1.4",
@@ -417,7 +417,7 @@
"@types/ms": ["@types/ms@2.1.0", "", {}, "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA=="], "@types/ms": ["@types/ms@2.1.0", "", {}, "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA=="],
"@types/node": ["@types/node@25.3.1", "", { "dependencies": { "undici-types": "~7.18.0" } }, "sha512-hj9YIJimBCipHVfHKRMnvmHg+wfhKc0o4mTtXh9pKBjC8TLJzz0nzGmLi5UJsYAUgSvXFHgb0V2oY10DUFtImw=="], "@types/node": ["@types/node@25.3.2", "", { "dependencies": { "undici-types": "~7.18.0" } }, "sha512-RpV6r/ij22zRRdyBPcxDeKAzH43phWVKEjL2iksqo1Vz3CuBUrgmPpPhALKiRfU7OMCmeeO9vECBMsV0hMTG8Q=="],
"@types/react": ["@types/react@19.2.14", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w=="], "@types/react": ["@types/react@19.2.14", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w=="],

View File

@@ -43,7 +43,7 @@
"devDependencies": { "devDependencies": {
"@eslint/js": "^10.0.1", "@eslint/js": "^10.0.1",
"@tanstack/eslint-plugin-query": "^5.91.4", "@tanstack/eslint-plugin-query": "^5.91.4",
"@types/node": "^25.3.1", "@types/node": "^25.3.2",
"@types/react": "^19.2.14", "@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3", "@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.4", "@vitejs/plugin-react": "^5.1.4",

View File

@@ -21,7 +21,6 @@ export const DomainWarning = (props: Props) => {
const { search } = useLocation(); const { search } = useLocation();
const searchParams = new URLSearchParams(search); const searchParams = new URLSearchParams(search);
const redirectUri = searchParams.get("redirect_uri");
return ( return (
<Card role="alert" aria-live="assertive"> <Card role="alert" aria-live="assertive">
@@ -46,9 +45,7 @@ export const DomainWarning = (props: Props) => {
<CardFooter className="flex flex-col items-stretch gap-3"> <CardFooter className="flex flex-col items-stretch gap-3">
<Button <Button
onClick={() => onClick={() =>
window.location.assign( window.location.assign(`${appUrl}/login?${searchParams.toString()}`)
`${appUrl}/login?redirect_uri=${encodeURIComponent(redirectUri || "")}`,
)
} }
variant="outline" variant="outline"
> >

View File

@@ -71,7 +71,7 @@
"authorizeErrorClientInfo": "Une erreur est survenue lors du chargement des informations du client. Veuillez réessayer plus tard.", "authorizeErrorClientInfo": "Une erreur est survenue lors du chargement des informations du client. Veuillez réessayer plus tard.",
"authorizeErrorMissingParams": "Les paramètres suivants sont manquants : {{missingParams}}", "authorizeErrorMissingParams": "Les paramètres suivants sont manquants : {{missingParams}}",
"openidScopeName": "Connexion OpenID", "openidScopeName": "Connexion OpenID",
"openidScopeDescription": "Allows the app to access your OpenID Connect information.", "openidScopeDescription": "Autorise l'application à accéder à vos informations \"OpenID Connect\".",
"emailScopeName": "Email", "emailScopeName": "Email",
"emailScopeDescription": "Autorise l'application à accéder à votre adresse e-mail.", "emailScopeDescription": "Autorise l'application à accéder à votre adresse e-mail.",
"profileScopeName": "Profil", "profileScopeName": "Profil",

View File

@@ -51,7 +51,7 @@
"forgotPasswordTitle": "Забули пароль?", "forgotPasswordTitle": "Забули пароль?",
"failedToFetchProvidersTitle": "Не вдалося завантажити провайдерів автентифікації. Будь ласка, перевірте вашу конфігурацію.", "failedToFetchProvidersTitle": "Не вдалося завантажити провайдерів автентифікації. Будь ласка, перевірте вашу конфігурацію.",
"errorTitle": "Виникла помилка", "errorTitle": "Виникла помилка",
"errorSubtitleInfo": "The following error occurred while processing your request:", "errorSubtitleInfo": "Під час обробки запиту сталась помилка:",
"errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.",
"forgotPasswordMessage": "Ви можете скинути пароль, змінивши змінну середовища \"USERS\".", "forgotPasswordMessage": "Ви можете скинути пароль, змінивши змінну середовища \"USERS\".",
"fieldRequired": "Це поле обов'язкове для заповнення", "fieldRequired": "Це поле обов'язкове для заповнення",
@@ -60,22 +60,22 @@
"domainWarningSubtitle": "Даний ресурс налаштований для доступу з <code>{{appUrl}}</code>, але використовується <code>{{currentUrl}}</code>. Якщо ви продовжите, можуть виникнути проблеми з автентифікацією.", "domainWarningSubtitle": "Даний ресурс налаштований для доступу з <code>{{appUrl}}</code>, але використовується <code>{{currentUrl}}</code>. Якщо ви продовжите, можуть виникнути проблеми з автентифікацією.",
"ignoreTitle": "Ігнорувати", "ignoreTitle": "Ігнорувати",
"goToCorrectDomainTitle": "Перейти за коректним доменом", "goToCorrectDomainTitle": "Перейти за коректним доменом",
"authorizeTitle": "Authorize", "authorizeTitle": "Авторизуватись",
"authorizeCardTitle": "Continue to {{app}}?", "authorizeCardTitle": "Перейти до {{app}}?",
"authorizeSubtitle": "Would you like to continue to this app? Please carefully review the permissions requested by the app.", "authorizeSubtitle": "Чи хочете ви продовжити роботу з цим додатком? Будь ласка, уважно перегляньте дозволи, які вимагає додаток.",
"authorizeSubtitleOAuth": "Would you like to continue to this app?", "authorizeSubtitleOAuth": "Бажаєте продовжити роботу з цим додатком?",
"authorizeLoadingTitle": "Loading...", "authorizeLoadingTitle": "Завантаження...",
"authorizeLoadingSubtitle": "Please wait while we load the client information.", "authorizeLoadingSubtitle": "Будь ласка, зачекайте, поки ми завантажуємо клієнтську інформацію.",
"authorizeSuccessTitle": "Authorized", "authorizeSuccessTitle": "Авторизовано",
"authorizeSuccessSubtitle": "You will be redirected to the app in a few seconds.", "authorizeSuccessSubtitle": "Вас буде перенаправлено до програми за декілька секунд.",
"authorizeErrorClientInfo": "An error occurred while loading the client information. Please try again later.", "authorizeErrorClientInfo": "Під час завантаження даних клієнта сталася помилка. Будь ласка, спробуйте ще раз пізніше.",
"authorizeErrorMissingParams": "The following parameters are missing: {{missingParams}}", "authorizeErrorMissingParams": "Відсутні наступні параметри: {{missingParams}}",
"openidScopeName": "OpenID Connect", "openidScopeName": "OpenID Connect",
"openidScopeDescription": "Allows the app to access your OpenID Connect information.", "openidScopeDescription": "Дозволяє програмі отримувати доступ до вашої інформації OpenID Connect.",
"emailScopeName": "Email", "emailScopeName": "Електронна пошта",
"emailScopeDescription": "Allows the app to access your email address.", "emailScopeDescription": "Дозволяє програмі отримувати доступ до вашої адреси електронної пошти.",
"profileScopeName": "Profile", "profileScopeName": "Профіль",
"profileScopeDescription": "Allows the app to access your profile information.", "profileScopeDescription": "Дозволяє програмі отримувати доступ до інформації вашого профілю.",
"groupsScopeName": "Groups", "groupsScopeName": "Групи",
"groupsScopeDescription": "Allows the app to access your group information." "groupsScopeDescription": "Дозволяє програмі отримувати доступ до інформації про групу."
} }

View File

@@ -41,11 +41,15 @@ var (
) )
type ClaimSet struct { type ClaimSet struct {
Iss string `json:"iss"` Iss string `json:"iss"`
Aud string `json:"aud"` Aud string `json:"aud"`
Sub string `json:"sub"` Sub string `json:"sub"`
Iat int64 `json:"iat"` Iat int64 `json:"iat"`
Exp int64 `json:"exp"` Exp int64 `json:"exp"`
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
PreferredUsername string `json:"preferred_username,omitempty"`
Groups []string `json:"groups,omitempty"`
} }
type UserinfoResponse struct { type UserinfoResponse struct {
@@ -53,7 +57,7 @@ type UserinfoResponse struct {
Name string `json:"name"` Name string `json:"name"`
Email string `json:"email"` Email string `json:"email"`
PreferredUsername string `json:"preferred_username"` PreferredUsername string `json:"preferred_username"`
Groups []string `json:"groups"` Groups []string `json:"groups,omitempty"`
UpdatedAt int64 `json:"updated_at"` UpdatedAt int64 `json:"updated_at"`
} }
@@ -349,7 +353,7 @@ func (service *OIDCService) GetCodeEntry(c *gin.Context, codeHash string) (repos
return oidcCode, nil return oidcCode, nil
} }
func (service *OIDCService) generateIDToken(client config.OIDCClientConfig, sub string) (string, error) { func (service *OIDCService) generateIDToken(client config.OIDCClientConfig, user repository.OidcUserinfo, scope string) (string, error) {
createdAt := time.Now().Unix() createdAt := time.Now().Unix()
expiresAt := time.Now().Add(time.Duration(service.config.SessionExpiry) * time.Second).Unix() expiresAt := time.Now().Add(time.Duration(service.config.SessionExpiry) * time.Second).Unix()
@@ -367,12 +371,18 @@ func (service *OIDCService) generateIDToken(client config.OIDCClientConfig, sub
return "", err return "", err
} }
userInfo := service.CompileUserinfo(user, scope)
claims := ClaimSet{ claims := ClaimSet{
Iss: service.issuer, Iss: service.issuer,
Aud: client.ClientID, Aud: client.ClientID,
Sub: sub, Sub: user.Sub,
Iat: createdAt, Iat: createdAt,
Exp: expiresAt, Exp: expiresAt,
Name: userInfo.Name,
Email: userInfo.Email,
PreferredUsername: userInfo.PreferredUsername,
Groups: userInfo.Groups,
} }
payload, err := json.Marshal(claims) payload, err := json.Marshal(claims)
@@ -397,7 +407,13 @@ func (service *OIDCService) generateIDToken(client config.OIDCClientConfig, sub
} }
func (service *OIDCService) GenerateAccessToken(c *gin.Context, client config.OIDCClientConfig, sub string, scope string) (TokenResponse, error) { func (service *OIDCService) GenerateAccessToken(c *gin.Context, client config.OIDCClientConfig, sub string, scope string) (TokenResponse, error) {
idToken, err := service.generateIDToken(client, sub) user, err := service.GetUserinfo(c, sub)
if err != nil {
return TokenResponse{}, err
}
idToken, err := service.generateIDToken(client, user, scope)
if err != nil { if err != nil {
return TokenResponse{}, err return TokenResponse{}, err
@@ -456,9 +472,15 @@ func (service *OIDCService) RefreshAccessToken(c *gin.Context, refreshToken stri
return TokenResponse{}, ErrInvalidClient return TokenResponse{}, ErrInvalidClient
} }
user, err := service.GetUserinfo(c, entry.Sub)
if err != nil {
return TokenResponse{}, err
}
idToken, err := service.generateIDToken(config.OIDCClientConfig{ idToken, err := service.generateIDToken(config.OIDCClientConfig{
ClientID: entry.ClientID, ClientID: entry.ClientID,
}, entry.Sub) }, user, entry.Scope)
if err != nil { if err != nil {
return TokenResponse{}, err return TokenResponse{}, err