diff --git a/pkg/api/oauth2_authentications.go b/pkg/api/oauth2_authentications.go index 019f3a50..07a1e760 100644 --- a/pkg/api/oauth2_authentications.go +++ b/pkg/api/oauth2_authentications.go @@ -21,7 +21,7 @@ import ( const oauth2CallbackPageUrlSuccessFormat = "%sdesktop/#/oauth2_callback?platform=%s&provider=%s&token=%s" const oauth2CallbackPageUrlNeedVerifyFormat = "%sdesktop/#/oauth2_callback?platform=%s&provider=%s&userName=%s&token=%s" -const oauth2CallbackPageUrlFailedFormat = "%sdesktop/#/oauth2_callback?error=%s" +const oauth2CallbackPageUrlFailedFormat = "%sdesktop/#/oauth2_callback?errorCode=%d&errorMessage=%s" // OAuth2AuthenticationApi represents OAuth 2.0 authorization api type OAuth2AuthenticationApi struct { @@ -309,5 +309,5 @@ func (a *OAuth2AuthenticationApi) redirectToVerifyCallbackPage(c *core.WebContex } func (a *OAuth2AuthenticationApi) redirectToFailedCallbackPage(c *core.WebContext, err *errs.Error) (string, *errs.Error) { - return fmt.Sprintf(oauth2CallbackPageUrlFailedFormat, a.CurrentConfig().RootUrl, url.QueryEscape(utils.GetDisplayErrorMessage(err))), nil + return fmt.Sprintf(oauth2CallbackPageUrlFailedFormat, a.CurrentConfig().RootUrl, err.Code(), url.QueryEscape(utils.GetDisplayErrorMessage(err))), nil } diff --git a/pkg/errs/oauth2.go b/pkg/errs/oauth2.go index c9058b3f..94a1274f 100644 --- a/pkg/errs/oauth2.go +++ b/pkg/errs/oauth2.go @@ -6,14 +6,14 @@ import ( // Error codes related to oauth 2.0 var ( - ErrOAuth2NotEnabled = NewNormalError(NormalSubcategoryOAuth2, 0, http.StatusUnauthorized, "oauth 2.0 not enabled") - ErrOAuth2AutoRegistrationNotEnabled = NewNormalError(NormalSubcategoryOAuth2, 1, http.StatusUnauthorized, "oauth 2.0 auto registration not enabled") - ErrInvalidOAuth2LoginRequest = NewNormalError(NormalSubcategoryOAuth2, 2, http.StatusUnauthorized, "invalid oauth 2.0 login request") - ErrInvalidOAuth2Callback = NewNormalError(NormalSubcategoryOAuth2, 3, http.StatusUnauthorized, "invalid oauth 2.0 callback") - ErrMissingOAuth2State = NewNormalError(NormalSubcategoryOAuth2, 4, http.StatusUnauthorized, "missing state in oauth 2.0 callback") - ErrMissingOAuth2Code = NewNormalError(NormalSubcategoryOAuth2, 5, http.StatusUnauthorized, "missing code in oauth 2.0 callback") - ErrInvalidOAuth2State = NewNormalError(NormalSubcategoryOAuth2, 6, http.StatusUnauthorized, "invalid state in oauth 2.0 callback") - ErrCannotRetrieveOAuth2Token = NewNormalError(NormalSubcategoryOAuth2, 7, http.StatusUnauthorized, "cannot retrieve oauth 2.0 token") - ErrInvalidOAuth2Token = NewNormalError(NormalSubcategoryOAuth2, 8, http.StatusUnauthorized, "invalid oauth 2.0 token") - ErrCannotRetrieveUserInfo = NewNormalError(NormalSubcategoryOAuth2, 9, http.StatusUnauthorized, "cannot retrieve user info from oauth 2.0 provider") + ErrOAuth2NotEnabled = NewNormalError(NormalSubcategoryOAuth2, 0, http.StatusUnauthorized, "oauth2 not enabled") + ErrOAuth2AutoRegistrationNotEnabled = NewNormalError(NormalSubcategoryOAuth2, 1, http.StatusUnauthorized, "oauth2 auto registration not enabled") + ErrInvalidOAuth2LoginRequest = NewNormalError(NormalSubcategoryOAuth2, 2, http.StatusUnauthorized, "invalid oauth2 login request") + ErrInvalidOAuth2Callback = NewNormalError(NormalSubcategoryOAuth2, 3, http.StatusUnauthorized, "invalid oauth2 callback") + ErrMissingOAuth2State = NewNormalError(NormalSubcategoryOAuth2, 4, http.StatusUnauthorized, "missing state in oauth2 callback") + ErrMissingOAuth2Code = NewNormalError(NormalSubcategoryOAuth2, 5, http.StatusUnauthorized, "missing code in oauth2 callback") + ErrInvalidOAuth2State = NewNormalError(NormalSubcategoryOAuth2, 6, http.StatusUnauthorized, "invalid state in oauth2 callback") + ErrCannotRetrieveOAuth2Token = NewNormalError(NormalSubcategoryOAuth2, 7, http.StatusUnauthorized, "cannot retrieve oauth2 token") + ErrInvalidOAuth2Token = NewNormalError(NormalSubcategoryOAuth2, 8, http.StatusUnauthorized, "invalid oauth2 token") + ErrCannotRetrieveUserInfo = NewNormalError(NormalSubcategoryOAuth2, 9, http.StatusUnauthorized, "cannot retrieve user info from oauth2 provider") ) diff --git a/src/locales/de.json b/src/locales/de.json index 745bf5ee..3ad2928c 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -1242,16 +1242,16 @@ "exceed the maximum size of image file for AI recognition": "The uploaded image for AI recognition exceeds the maximum allowed file size", "no transaction information detected": "No transaction information detected", "user external auth is not found": "User external authentication is not found", - "oauth 2.0 not enabled": "OAuth 2.0 is not enabled", - "oauth 2.0 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", - "invalid oauth 2.0 login request": "Invalid OAuth 2.0 login request", - "invalid oauth 2.0 callback": "Invalid OAuth 2.0 callback", - "missing state in oauth 2.0 callback": "Missing state parameter in OAuth 2.0 callback", - "missing code in oauth 2.0 callback": "Missing code parameter in OAuth 2.0 callback", - "invalid state in oauth 2.0 callback": "Invalid state parameter in OAuth 2.0 callback", - "cannot retrieve oauth 2.0 token": "Cannot retrieve OAuth 2.0 token", - "invalid oauth 2.0 token": "Invalid OAuth 2.0 token", - "cannot retrieve user info from oauth 2.0 provider": "Cannot retrieve user info from OAuth 2.0 provider", + "oauth2 not enabled": "OAuth 2.0 is not enabled", + "oauth2 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", + "invalid oauth2 login request": "Invalid OAuth 2.0 login request", + "invalid oauth2 callback": "Invalid OAuth 2.0 callback", + "missing state in oauth2 callback": "Missing state parameter in OAuth 2.0 callback", + "missing code in oauth2 callback": "Missing code parameter in OAuth 2.0 callback", + "invalid state in oauth2 callback": "Invalid state parameter in OAuth 2.0 callback", + "cannot retrieve oauth2 token": "Cannot retrieve OAuth 2.0 token", + "invalid oauth2 token": "Invalid OAuth 2.0 token", + "cannot retrieve user info from oauth2 provider": "Cannot retrieve user info from OAuth 2.0 provider", "query items cannot be blank": "Abfrageelemente dürfen nicht leer sein", "query items too much": "Zu viele Abfrageelemente", "query items have invalid item": "Ungültiges Element in Abfrageelementen", diff --git a/src/locales/en.json b/src/locales/en.json index d7b54a52..38b723a6 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1242,16 +1242,16 @@ "exceed the maximum size of image file for AI recognition": "The uploaded image for AI recognition exceeds the maximum allowed file size", "no transaction information detected": "No transaction information detected", "user external auth is not found": "User external authentication is not found", - "oauth 2.0 not enabled": "OAuth 2.0 is not enabled", - "oauth 2.0 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", - "invalid oauth 2.0 login request": "Invalid OAuth 2.0 login request", - "invalid oauth 2.0 callback": "Invalid OAuth 2.0 callback", - "missing state in oauth 2.0 callback": "Missing state parameter in OAuth 2.0 callback", - "missing code in oauth 2.0 callback": "Missing code parameter in OAuth 2.0 callback", - "invalid state in oauth 2.0 callback": "Invalid state parameter in OAuth 2.0 callback", - "cannot retrieve oauth 2.0 token": "Cannot retrieve OAuth 2.0 token", - "invalid oauth 2.0 token": "Invalid OAuth 2.0 token", - "cannot retrieve user info from oauth 2.0 provider": "Cannot retrieve user info from OAuth 2.0 provider", + "oauth2 not enabled": "OAuth 2.0 is not enabled", + "oauth2 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", + "invalid oauth2 login request": "Invalid OAuth 2.0 login request", + "invalid oauth2 callback": "Invalid OAuth 2.0 callback", + "missing state in oauth2 callback": "Missing state parameter in OAuth 2.0 callback", + "missing code in oauth2 callback": "Missing code parameter in OAuth 2.0 callback", + "invalid state in oauth2 callback": "Invalid state parameter in OAuth 2.0 callback", + "cannot retrieve oauth2 token": "Cannot retrieve OAuth 2.0 token", + "invalid oauth2 token": "Invalid OAuth 2.0 token", + "cannot retrieve user info from oauth2 provider": "Cannot retrieve user info from OAuth 2.0 provider", "query items cannot be blank": "There are no query items", "query items too much": "There are too many query items", "query items have invalid item": "There is invalid item in query items", diff --git a/src/locales/es.json b/src/locales/es.json index f29a3965..23b1114a 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -1242,16 +1242,16 @@ "exceed the maximum size of image file for AI recognition": "The uploaded image for AI recognition exceeds the maximum allowed file size", "no transaction information detected": "No transaction information detected", "user external auth is not found": "User external authentication is not found", - "oauth 2.0 not enabled": "OAuth 2.0 is not enabled", - "oauth 2.0 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", - "invalid oauth 2.0 login request": "Invalid OAuth 2.0 login request", - "invalid oauth 2.0 callback": "Invalid OAuth 2.0 callback", - "missing state in oauth 2.0 callback": "Missing state parameter in OAuth 2.0 callback", - "missing code in oauth 2.0 callback": "Missing code parameter in OAuth 2.0 callback", - "invalid state in oauth 2.0 callback": "Invalid state parameter in OAuth 2.0 callback", - "cannot retrieve oauth 2.0 token": "Cannot retrieve OAuth 2.0 token", - "invalid oauth 2.0 token": "Invalid OAuth 2.0 token", - "cannot retrieve user info from oauth 2.0 provider": "Cannot retrieve user info from OAuth 2.0 provider", + "oauth2 not enabled": "OAuth 2.0 is not enabled", + "oauth2 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", + "invalid oauth2 login request": "Invalid OAuth 2.0 login request", + "invalid oauth2 callback": "Invalid OAuth 2.0 callback", + "missing state in oauth2 callback": "Missing state parameter in OAuth 2.0 callback", + "missing code in oauth2 callback": "Missing code parameter in OAuth 2.0 callback", + "invalid state in oauth2 callback": "Invalid state parameter in OAuth 2.0 callback", + "cannot retrieve oauth2 token": "Cannot retrieve OAuth 2.0 token", + "invalid oauth2 token": "Invalid OAuth 2.0 token", + "cannot retrieve user info from oauth2 provider": "Cannot retrieve user info from OAuth 2.0 provider", "query items cannot be blank": "--", "query items too much": "--", "query items have invalid item": "Hay un elemento no válido en los elementos de consulta", diff --git a/src/locales/fr.json b/src/locales/fr.json index 315ad2bc..0c24e32b 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -1242,16 +1242,16 @@ "exceed the maximum size of image file for AI recognition": "L'image téléchargée pour la reconnaissance IA dépasse la taille de fichier maximale autorisée", "no transaction information detected": "Aucune information de transaction détectée", "user external auth is not found": "User external authentication is not found", - "oauth 2.0 not enabled": "OAuth 2.0 is not enabled", - "oauth 2.0 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", - "invalid oauth 2.0 login request": "Invalid OAuth 2.0 login request", - "invalid oauth 2.0 callback": "Invalid OAuth 2.0 callback", - "missing state in oauth 2.0 callback": "Missing state parameter in OAuth 2.0 callback", - "missing code in oauth 2.0 callback": "Missing code parameter in OAuth 2.0 callback", - "invalid state in oauth 2.0 callback": "Invalid state parameter in OAuth 2.0 callback", - "cannot retrieve oauth 2.0 token": "Cannot retrieve OAuth 2.0 token", - "invalid oauth 2.0 token": "Invalid OAuth 2.0 token", - "cannot retrieve user info from oauth 2.0 provider": "Cannot retrieve user info from OAuth 2.0 provider", + "oauth2 not enabled": "OAuth 2.0 is not enabled", + "oauth2 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", + "invalid oauth2 login request": "Invalid OAuth 2.0 login request", + "invalid oauth2 callback": "Invalid OAuth 2.0 callback", + "missing state in oauth2 callback": "Missing state parameter in OAuth 2.0 callback", + "missing code in oauth2 callback": "Missing code parameter in OAuth 2.0 callback", + "invalid state in oauth2 callback": "Invalid state parameter in OAuth 2.0 callback", + "cannot retrieve oauth2 token": "Cannot retrieve OAuth 2.0 token", + "invalid oauth2 token": "Invalid OAuth 2.0 token", + "cannot retrieve user info from oauth2 provider": "Cannot retrieve user info from OAuth 2.0 provider", "query items cannot be blank": "Il n'y a pas d'éléments de requête", "query items too much": "Il y a trop d'éléments de requête", "query items have invalid item": "Il y a un élément invalide dans les éléments de requête", diff --git a/src/locales/it.json b/src/locales/it.json index a7d14ba3..12b20c55 100644 --- a/src/locales/it.json +++ b/src/locales/it.json @@ -1242,16 +1242,16 @@ "exceed the maximum size of image file for AI recognition": "The uploaded image for AI recognition exceeds the maximum allowed file size", "no transaction information detected": "No transaction information detected", "user external auth is not found": "User external authentication is not found", - "oauth 2.0 not enabled": "OAuth 2.0 is not enabled", - "oauth 2.0 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", - "invalid oauth 2.0 login request": "Invalid OAuth 2.0 login request", - "invalid oauth 2.0 callback": "Invalid OAuth 2.0 callback", - "missing state in oauth 2.0 callback": "Missing state parameter in OAuth 2.0 callback", - "missing code in oauth 2.0 callback": "Missing code parameter in OAuth 2.0 callback", - "invalid state in oauth 2.0 callback": "Invalid state parameter in OAuth 2.0 callback", - "cannot retrieve oauth 2.0 token": "Cannot retrieve OAuth 2.0 token", - "invalid oauth 2.0 token": "Invalid OAuth 2.0 token", - "cannot retrieve user info from oauth 2.0 provider": "Cannot retrieve user info from OAuth 2.0 provider", + "oauth2 not enabled": "OAuth 2.0 is not enabled", + "oauth2 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", + "invalid oauth2 login request": "Invalid OAuth 2.0 login request", + "invalid oauth2 callback": "Invalid OAuth 2.0 callback", + "missing state in oauth2 callback": "Missing state parameter in OAuth 2.0 callback", + "missing code in oauth2 callback": "Missing code parameter in OAuth 2.0 callback", + "invalid state in oauth2 callback": "Invalid state parameter in OAuth 2.0 callback", + "cannot retrieve oauth2 token": "Cannot retrieve OAuth 2.0 token", + "invalid oauth2 token": "Invalid OAuth 2.0 token", + "cannot retrieve user info from oauth2 provider": "Cannot retrieve user info from OAuth 2.0 provider", "query items cannot be blank": "Non ci sono elementi di query", "query items too much": "Ci sono troppi elementi di query", "query items have invalid item": "C'è un elemento non valido negli elementi di query", diff --git a/src/locales/ja.json b/src/locales/ja.json index 8c0e2871..d8705914 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -1242,16 +1242,16 @@ "exceed the maximum size of image file for AI recognition": "The uploaded image for AI recognition exceeds the maximum allowed file size", "no transaction information detected": "No transaction information detected", "user external auth is not found": "User external authentication is not found", - "oauth 2.0 not enabled": "OAuth 2.0 is not enabled", - "oauth 2.0 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", - "invalid oauth 2.0 login request": "Invalid OAuth 2.0 login request", - "invalid oauth 2.0 callback": "Invalid OAuth 2.0 callback", - "missing state in oauth 2.0 callback": "Missing state parameter in OAuth 2.0 callback", - "missing code in oauth 2.0 callback": "Missing code parameter in OAuth 2.0 callback", - "invalid state in oauth 2.0 callback": "Invalid state parameter in OAuth 2.0 callback", - "cannot retrieve oauth 2.0 token": "Cannot retrieve OAuth 2.0 token", - "invalid oauth 2.0 token": "Invalid OAuth 2.0 token", - "cannot retrieve user info from oauth 2.0 provider": "Cannot retrieve user info from OAuth 2.0 provider", + "oauth2 not enabled": "OAuth 2.0 is not enabled", + "oauth2 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", + "invalid oauth2 login request": "Invalid OAuth 2.0 login request", + "invalid oauth2 callback": "Invalid OAuth 2.0 callback", + "missing state in oauth2 callback": "Missing state parameter in OAuth 2.0 callback", + "missing code in oauth2 callback": "Missing code parameter in OAuth 2.0 callback", + "invalid state in oauth2 callback": "Invalid state parameter in OAuth 2.0 callback", + "cannot retrieve oauth2 token": "Cannot retrieve OAuth 2.0 token", + "invalid oauth2 token": "Invalid OAuth 2.0 token", + "cannot retrieve user info from oauth2 provider": "Cannot retrieve user info from OAuth 2.0 provider", "query items cannot be blank": "クエリ項目がありません", "query items too much": "クエリ項目が多すぎます", "query items have invalid item": "クエリ項目に無効な項目があります", diff --git a/src/locales/ko.json b/src/locales/ko.json index 32c4aa98..7470e540 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -1242,16 +1242,16 @@ "exceed the maximum size of image file for AI recognition": "AI 인식을 위한 업로드된 이미지가 허용된 최대 파일 크기를 초과합니다.", "no transaction information detected": "거래 정보가 감지되지 않았습니다.", "user external auth is not found": "User external authentication is not found", - "oauth 2.0 not enabled": "OAuth 2.0 is not enabled", - "oauth 2.0 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", - "invalid oauth 2.0 login request": "Invalid OAuth 2.0 login request", - "invalid oauth 2.0 callback": "Invalid OAuth 2.0 callback", - "missing state in oauth 2.0 callback": "Missing state parameter in OAuth 2.0 callback", - "missing code in oauth 2.0 callback": "Missing code parameter in OAuth 2.0 callback", - "invalid state in oauth 2.0 callback": "Invalid state parameter in OAuth 2.0 callback", - "cannot retrieve oauth 2.0 token": "Cannot retrieve OAuth 2.0 token", - "invalid oauth 2.0 token": "Invalid OAuth 2.0 token", - "cannot retrieve user info from oauth 2.0 provider": "Cannot retrieve user info from OAuth 2.0 provider", + "oauth2 not enabled": "OAuth 2.0 is not enabled", + "oauth2 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", + "invalid oauth2 login request": "Invalid OAuth 2.0 login request", + "invalid oauth2 callback": "Invalid OAuth 2.0 callback", + "missing state in oauth2 callback": "Missing state parameter in OAuth 2.0 callback", + "missing code in oauth2 callback": "Missing code parameter in OAuth 2.0 callback", + "invalid state in oauth2 callback": "Invalid state parameter in OAuth 2.0 callback", + "cannot retrieve oauth2 token": "Cannot retrieve OAuth 2.0 token", + "invalid oauth2 token": "Invalid OAuth 2.0 token", + "cannot retrieve user info from oauth2 provider": "Cannot retrieve user info from OAuth 2.0 provider", "query items cannot be blank": "쿼리 항목이 비어 있을 수 없습니다.", "query items too much": "쿼리 항목이 너무 많습니다.", "query items have invalid item": "쿼리 항목에 유효하지 않은 항목이 있습니다.", diff --git a/src/locales/nl.json b/src/locales/nl.json index 9eea5944..7945aa18 100644 --- a/src/locales/nl.json +++ b/src/locales/nl.json @@ -1242,16 +1242,16 @@ "exceed the maximum size of image file for AI recognition": "The uploaded image for AI recognition exceeds the maximum allowed file size", "no transaction information detected": "No transaction information detected", "user external auth is not found": "User external authentication is not found", - "oauth 2.0 not enabled": "OAuth 2.0 is not enabled", - "oauth 2.0 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", - "invalid oauth 2.0 login request": "Invalid OAuth 2.0 login request", - "invalid oauth 2.0 callback": "Invalid OAuth 2.0 callback", - "missing state in oauth 2.0 callback": "Missing state parameter in OAuth 2.0 callback", - "missing code in oauth 2.0 callback": "Missing code parameter in OAuth 2.0 callback", - "invalid state in oauth 2.0 callback": "Invalid state parameter in OAuth 2.0 callback", - "cannot retrieve oauth 2.0 token": "Cannot retrieve OAuth 2.0 token", - "invalid oauth 2.0 token": "Invalid OAuth 2.0 token", - "cannot retrieve user info from oauth 2.0 provider": "Cannot retrieve user info from OAuth 2.0 provider", + "oauth2 not enabled": "OAuth 2.0 is not enabled", + "oauth2 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", + "invalid oauth2 login request": "Invalid OAuth 2.0 login request", + "invalid oauth2 callback": "Invalid OAuth 2.0 callback", + "missing state in oauth2 callback": "Missing state parameter in OAuth 2.0 callback", + "missing code in oauth2 callback": "Missing code parameter in OAuth 2.0 callback", + "invalid state in oauth2 callback": "Invalid state parameter in OAuth 2.0 callback", + "cannot retrieve oauth2 token": "Cannot retrieve OAuth 2.0 token", + "invalid oauth2 token": "Invalid OAuth 2.0 token", + "cannot retrieve user info from oauth2 provider": "Cannot retrieve user info from OAuth 2.0 provider", "query items cannot be blank": "Geen zoekitems opgegeven", "query items too much": "Te veel zoekitems", "query items have invalid item": "Ongeldig item in zoekitems", diff --git a/src/locales/pt_BR.json b/src/locales/pt_BR.json index 12d83f9e..7ec81c66 100644 --- a/src/locales/pt_BR.json +++ b/src/locales/pt_BR.json @@ -1242,16 +1242,16 @@ "exceed the maximum size of image file for AI recognition": "The uploaded image for AI recognition exceeds the maximum allowed file size", "no transaction information detected": "No transaction information detected", "user external auth is not found": "User external authentication is not found", - "oauth 2.0 not enabled": "OAuth 2.0 is not enabled", - "oauth 2.0 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", - "invalid oauth 2.0 login request": "Invalid OAuth 2.0 login request", - "invalid oauth 2.0 callback": "Invalid OAuth 2.0 callback", - "missing state in oauth 2.0 callback": "Missing state parameter in OAuth 2.0 callback", - "missing code in oauth 2.0 callback": "Missing code parameter in OAuth 2.0 callback", - "invalid state in oauth 2.0 callback": "Invalid state parameter in OAuth 2.0 callback", - "cannot retrieve oauth 2.0 token": "Cannot retrieve OAuth 2.0 token", - "invalid oauth 2.0 token": "Invalid OAuth 2.0 token", - "cannot retrieve user info from oauth 2.0 provider": "Cannot retrieve user info from OAuth 2.0 provider", + "oauth2 not enabled": "OAuth 2.0 is not enabled", + "oauth2 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", + "invalid oauth2 login request": "Invalid OAuth 2.0 login request", + "invalid oauth2 callback": "Invalid OAuth 2.0 callback", + "missing state in oauth2 callback": "Missing state parameter in OAuth 2.0 callback", + "missing code in oauth2 callback": "Missing code parameter in OAuth 2.0 callback", + "invalid state in oauth2 callback": "Invalid state parameter in OAuth 2.0 callback", + "cannot retrieve oauth2 token": "Cannot retrieve OAuth 2.0 token", + "invalid oauth2 token": "Invalid OAuth 2.0 token", + "cannot retrieve user info from oauth2 provider": "Cannot retrieve user info from OAuth 2.0 provider", "query items cannot be blank": "Não há itens de consulta", "query items too much": "Há muitos itens de consulta", "query items have invalid item": "Há item inválido nos itens de consulta", diff --git a/src/locales/ru.json b/src/locales/ru.json index 32411cef..36b21121 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -1242,16 +1242,16 @@ "exceed the maximum size of image file for AI recognition": "The uploaded image for AI recognition exceeds the maximum allowed file size", "no transaction information detected": "No transaction information detected", "user external auth is not found": "User external authentication is not found", - "oauth 2.0 not enabled": "OAuth 2.0 is not enabled", - "oauth 2.0 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", - "invalid oauth 2.0 login request": "Invalid OAuth 2.0 login request", - "invalid oauth 2.0 callback": "Invalid OAuth 2.0 callback", - "missing state in oauth 2.0 callback": "Missing state parameter in OAuth 2.0 callback", - "missing code in oauth 2.0 callback": "Missing code parameter in OAuth 2.0 callback", - "invalid state in oauth 2.0 callback": "Invalid state parameter in OAuth 2.0 callback", - "cannot retrieve oauth 2.0 token": "Cannot retrieve OAuth 2.0 token", - "invalid oauth 2.0 token": "Invalid OAuth 2.0 token", - "cannot retrieve user info from oauth 2.0 provider": "Cannot retrieve user info from OAuth 2.0 provider", + "oauth2 not enabled": "OAuth 2.0 is not enabled", + "oauth2 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", + "invalid oauth2 login request": "Invalid OAuth 2.0 login request", + "invalid oauth2 callback": "Invalid OAuth 2.0 callback", + "missing state in oauth2 callback": "Missing state parameter in OAuth 2.0 callback", + "missing code in oauth2 callback": "Missing code parameter in OAuth 2.0 callback", + "invalid state in oauth2 callback": "Invalid state parameter in OAuth 2.0 callback", + "cannot retrieve oauth2 token": "Cannot retrieve OAuth 2.0 token", + "invalid oauth2 token": "Invalid OAuth 2.0 token", + "cannot retrieve user info from oauth2 provider": "Cannot retrieve user info from OAuth 2.0 provider", "query items cannot be blank": "Нет элементов запроса", "query items too much": "Слишком много элементов запроса", "query items have invalid item": "В элементах запроса присутствует недопустимый элемент", diff --git a/src/locales/th.json b/src/locales/th.json index e5a4c875..05e1029a 100644 --- a/src/locales/th.json +++ b/src/locales/th.json @@ -1242,16 +1242,16 @@ "exceed the maximum size of image file for AI recognition": "ไฟล์รูปภาพสำหรับการจดจำด้วย AI เกินขนาดสูงสุดที่อนุญาต", "no transaction information detected": "ไม่พบข้อมูลธุรกรรม", "user external auth is not found": "User external authentication is not found", - "oauth 2.0 not enabled": "OAuth 2.0 is not enabled", - "oauth 2.0 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", - "invalid oauth 2.0 login request": "Invalid OAuth 2.0 login request", - "invalid oauth 2.0 callback": "Invalid OAuth 2.0 callback", - "missing state in oauth 2.0 callback": "Missing state parameter in OAuth 2.0 callback", - "missing code in oauth 2.0 callback": "Missing code parameter in OAuth 2.0 callback", - "invalid state in oauth 2.0 callback": "Invalid state parameter in OAuth 2.0 callback", - "cannot retrieve oauth 2.0 token": "Cannot retrieve OAuth 2.0 token", - "invalid oauth 2.0 token": "Invalid OAuth 2.0 token", - "cannot retrieve user info from oauth 2.0 provider": "Cannot retrieve user info from OAuth 2.0 provider", + "oauth2 not enabled": "OAuth 2.0 is not enabled", + "oauth2 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", + "invalid oauth2 login request": "Invalid OAuth 2.0 login request", + "invalid oauth2 callback": "Invalid OAuth 2.0 callback", + "missing state in oauth2 callback": "Missing state parameter in OAuth 2.0 callback", + "missing code in oauth2 callback": "Missing code parameter in OAuth 2.0 callback", + "invalid state in oauth2 callback": "Invalid state parameter in OAuth 2.0 callback", + "cannot retrieve oauth2 token": "Cannot retrieve OAuth 2.0 token", + "invalid oauth2 token": "Invalid OAuth 2.0 token", + "cannot retrieve user info from oauth2 provider": "Cannot retrieve user info from OAuth 2.0 provider", "query items cannot be blank": "ไม่มีรายการสำหรับค้นหา", "query items too much": "รายการค้นหามากเกินไป", "query items have invalid item": "มีรายการไม่ถูกต้องในรายการค้นหา", diff --git a/src/locales/uk.json b/src/locales/uk.json index 793521ea..0832afc7 100644 --- a/src/locales/uk.json +++ b/src/locales/uk.json @@ -1242,16 +1242,16 @@ "exceed the maximum size of image file for AI recognition": "The uploaded image for AI recognition exceeds the maximum allowed file size", "no transaction information detected": "No transaction information detected", "user external auth is not found": "User external authentication is not found", - "oauth 2.0 not enabled": "OAuth 2.0 is not enabled", - "oauth 2.0 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", - "invalid oauth 2.0 login request": "Invalid OAuth 2.0 login request", - "invalid oauth 2.0 callback": "Invalid OAuth 2.0 callback", - "missing state in oauth 2.0 callback": "Missing state parameter in OAuth 2.0 callback", - "missing code in oauth 2.0 callback": "Missing code parameter in OAuth 2.0 callback", - "invalid state in oauth 2.0 callback": "Invalid state parameter in OAuth 2.0 callback", - "cannot retrieve oauth 2.0 token": "Cannot retrieve OAuth 2.0 token", - "invalid oauth 2.0 token": "Invalid OAuth 2.0 token", - "cannot retrieve user info from oauth 2.0 provider": "Cannot retrieve user info from OAuth 2.0 provider", + "oauth2 not enabled": "OAuth 2.0 is not enabled", + "oauth2 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", + "invalid oauth2 login request": "Invalid OAuth 2.0 login request", + "invalid oauth2 callback": "Invalid OAuth 2.0 callback", + "missing state in oauth2 callback": "Missing state parameter in OAuth 2.0 callback", + "missing code in oauth2 callback": "Missing code parameter in OAuth 2.0 callback", + "invalid state in oauth2 callback": "Invalid state parameter in OAuth 2.0 callback", + "cannot retrieve oauth2 token": "Cannot retrieve OAuth 2.0 token", + "invalid oauth2 token": "Invalid OAuth 2.0 token", + "cannot retrieve user info from oauth2 provider": "Cannot retrieve user info from OAuth 2.0 provider", "query items cannot be blank": "Елементи запиту не можуть бути порожніми", "query items too much": "Занадто багато елементів запиту", "query items have invalid item": "Запит містить недійсний елемент", diff --git a/src/locales/vi.json b/src/locales/vi.json index 71e76f3c..1e979a4d 100644 --- a/src/locales/vi.json +++ b/src/locales/vi.json @@ -1242,16 +1242,16 @@ "exceed the maximum size of image file for AI recognition": "The uploaded image for AI recognition exceeds the maximum allowed file size", "no transaction information detected": "No transaction information detected", "user external auth is not found": "User external authentication is not found", - "oauth 2.0 not enabled": "OAuth 2.0 is not enabled", - "oauth 2.0 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", - "invalid oauth 2.0 login request": "Invalid OAuth 2.0 login request", - "invalid oauth 2.0 callback": "Invalid OAuth 2.0 callback", - "missing state in oauth 2.0 callback": "Missing state parameter in OAuth 2.0 callback", - "missing code in oauth 2.0 callback": "Missing code parameter in OAuth 2.0 callback", - "invalid state in oauth 2.0 callback": "Invalid state parameter in OAuth 2.0 callback", - "cannot retrieve oauth 2.0 token": "Cannot retrieve OAuth 2.0 token", - "invalid oauth 2.0 token": "Invalid OAuth 2.0 token", - "cannot retrieve user info from oauth 2.0 provider": "Cannot retrieve user info from OAuth 2.0 provider", + "oauth2 not enabled": "OAuth 2.0 is not enabled", + "oauth2 auto registration not enabled": "OAuth 2.0 auto registration is not enabled", + "invalid oauth2 login request": "Invalid OAuth 2.0 login request", + "invalid oauth2 callback": "Invalid OAuth 2.0 callback", + "missing state in oauth2 callback": "Missing state parameter in OAuth 2.0 callback", + "missing code in oauth2 callback": "Missing code parameter in OAuth 2.0 callback", + "invalid state in oauth2 callback": "Invalid state parameter in OAuth 2.0 callback", + "cannot retrieve oauth2 token": "Cannot retrieve OAuth 2.0 token", + "invalid oauth2 token": "Invalid OAuth 2.0 token", + "cannot retrieve user info from oauth2 provider": "Cannot retrieve user info from OAuth 2.0 provider", "query items cannot be blank": "Không có mục truy vấn", "query items too much": "Có quá nhiều mục truy vấn", "query items have invalid item": "Có mục không hợp lệ trong các mục truy vấn", diff --git a/src/locales/zh_Hans.json b/src/locales/zh_Hans.json index 24ea5956..5d885b7a 100644 --- a/src/locales/zh_Hans.json +++ b/src/locales/zh_Hans.json @@ -1242,16 +1242,16 @@ "exceed the maximum size of image file for AI recognition": "用于AI识别的图片超出了允许的最大文件大小", "no transaction information detected": "没有检测到交易信息", "user external auth is not found": "用户外部认证信息不存在", - "oauth 2.0 not enabled": "OAuth 2.0 没有启用", - "oauth 2.0 auto registration not enabled": "OAuth 2.0 自动注册没有启用", - "invalid oauth 2.0 login request": "无效的 OAuth 2.0 登录请求", - "invalid oauth 2.0 callback": "无效的 OAuth 2.0 回调请求", - "missing state in oauth 2.0 callback": "OAuth 2.0 回调中缺少 state 参数", - "missing code in oauth 2.0 callback": "OAuth 2.0 回调中缺少 code 参数", - "invalid state in oauth 2.0 callback": "OAuth 2.0 回调中的 state 参数无效", - "cannot retrieve oauth 2.0 token": "无法获取 OAuth 2.0 令牌", - "invalid oauth 2.0 token": "无效的 OAuth 2.0 令牌", - "cannot retrieve user info from oauth 2.0 provider": "无法从 OAuth 2.0 提供者获取用户信息", + "oauth2 not enabled": "OAuth 2.0 没有启用", + "oauth2 auto registration not enabled": "OAuth 2.0 自动注册没有启用", + "invalid oauth2 login request": "无效的 OAuth 2.0 登录请求", + "invalid oauth2 callback": "无效的 OAuth 2.0 回调请求", + "missing state in oauth2 callback": "OAuth 2.0 回调中缺少 state 参数", + "missing code in oauth2 callback": "OAuth 2.0 回调中缺少 code 参数", + "invalid state in oauth2 callback": "OAuth 2.0 回调中的 state 参数无效", + "cannot retrieve oauth2 token": "无法获取 OAuth 2.0 令牌", + "invalid oauth2 token": "无效的 OAuth 2.0 令牌", + "cannot retrieve user info from oauth2 provider": "无法从 OAuth 2.0 提供者获取用户信息", "query items cannot be blank": "请求项目不能为空", "query items too much": "请求项目过多", "query items have invalid item": "请求项目中有非法项目", diff --git a/src/locales/zh_Hant.json b/src/locales/zh_Hant.json index 6d6eb1af..954ebbfa 100644 --- a/src/locales/zh_Hant.json +++ b/src/locales/zh_Hant.json @@ -1242,16 +1242,16 @@ "exceed the maximum size of image file for AI recognition": "用於AI識別的圖片超出了允許的最大檔案大小", "no transaction information detected": "沒有檢測到交易資訊", "user external auth is not found": "使用者外部驗證資訊不存在", - "oauth 2.0 not enabled": "OAuth 2.0 未啟用", - "oauth 2.0 auto registration not enabled": "OAuth 2.0 自動註冊未啟用", - "invalid oauth 2.0 login request": "無效的 OAuth 2.0 登入請求", - "invalid oauth 2.0 callback": "無效的 OAuth 2.0 回調請求", - "missing state in oauth 2.0 callback": "OAuth 2.0 回調中缺少 state 參數", - "missing code in oauth 2.0 callback": "OAuth 2.0 回調中缺少 code 參數", - "invalid state in oauth 2.0 callback": "OAuth 2.0 回調中的 state 參數無效", - "cannot retrieve oauth 2.0 token": "無法獲取 OAuth 2.0 令牌", - "invalid oauth 2.0 token": "無效的 OAuth 2.0 令牌", - "cannot retrieve user info from oauth 2.0 provider": "無法從 OAuth 2.0 提供者獲取使用者資訊", + "oauth2 not enabled": "OAuth 2.0 未啟用", + "oauth2 auto registration not enabled": "OAuth 2.0 自動註冊未啟用", + "invalid oauth2 login request": "無效的 OAuth 2.0 登入請求", + "invalid oauth2 callback": "無效的 OAuth 2.0 回調請求", + "missing state in oauth2 callback": "OAuth 2.0 回調中缺少 state 參數", + "missing code in oauth2 callback": "OAuth 2.0 回調中缺少 code 參數", + "invalid state in oauth2 callback": "OAuth 2.0 回調中的 state 參數無效", + "cannot retrieve oauth2 token": "無法獲取 OAuth 2.0 令牌", + "invalid oauth2 token": "無效的 OAuth 2.0 令牌", + "cannot retrieve user info from oauth2 provider": "無法從 OAuth 2.0 提供者獲取使用者資訊", "query items cannot be blank": "查詢項目不能為空", "query items too much": "查詢項目過多", "query items have invalid item": "查詢項目中有非法項目", diff --git a/src/router/desktop.ts b/src/router/desktop.ts index b039c9e0..5c363b8b 100644 --- a/src/router/desktop.ts +++ b/src/router/desktop.ts @@ -235,7 +235,8 @@ const router = createRouter({ provider: route.query['provider'], platform: route.query['platform'], userName: route.query['userName'], - error: route.query['error'] + errorCode: route.query['errorCode'], + errorMessage: route.query['errorMessage'] }) }, { diff --git a/src/views/desktop/OAuth2CallbackPage.vue b/src/views/desktop/OAuth2CallbackPage.vue index 16da18db..464dbd7c 100644 --- a/src/views/desktop/OAuth2CallbackPage.vue +++ b/src/views/desktop/OAuth2CallbackPage.vue @@ -26,7 +26,7 @@
{{ tt('Logging in...') }}
{{ tt('format.misc.oauth2bindTip', { providerName: oauth2ProviderDisplayName, userName: userName }) }}
-{{ tt(error) }}
+{{ te({ error }) }}
{{ tt('An error occurred') }}
@@ -106,6 +106,7 @@ import { useLoginPageBase } from '@/views/base/LoginPageBase.ts'; import { useRootStore } from '@/stores/index.ts'; import { ThemeType } from '@/core/theme.ts'; +import { type ErrorResponse } from '@/core/api.ts'; import { APPLICATION_LOGO_PATH } from '@/consts/asset.ts'; import { KnownErrorCode } from '@/consts/api.ts'; @@ -127,13 +128,14 @@ const props = defineProps<{ provider?: string; platform?: string; userName?: string; - error?: string; + errorCode?: string; + errorMessage?: string; }>(); const router = useRouter(); const theme = useTheme(); -const { tt, getLocalizedOAuth2ProviderName, getLocalizedOAuth2LoginText } = useI18n(); +const { tt, te, getLocalizedOAuth2ProviderName, getLocalizedOAuth2LoginText } = useI18n(); const rootStore = useRootStore(); @@ -150,6 +152,21 @@ const isDarkMode = computed