@@ -44,17 +57,22 @@
- You will be redirected to
- {{ redirectUri }}
+
+
+
+
+
+
+
@@ -68,6 +86,36 @@ import { useAuth } from '@/composables/auth.js'
import { useScopes } from '@/composables/auth/scopes.ts'
+const { formatMessage } = useVIntl()
+
+const messages = defineMessages({
+ appInfo: {
+ id: 'auth.authorize.app-info',
+ defaultMessage:
+ '
{appName} by
{creator} will be able to:',
+ },
+ authorize: {
+ id: 'auth.authorize.action.authorize',
+ defaultMessage: 'Authorize',
+ },
+ decline: {
+ id: 'auth.authorize.action.decline',
+ defaultMessage: 'Decline',
+ },
+ noRedirectUrlError: {
+ id: 'auth.authorize.error.no-redirect-url',
+ defaultMessage: 'No redirect location found in response',
+ },
+ redirectUrl: {
+ id: 'auth.authorize.redirect-url',
+ defaultMessage: 'You will be redirected to
{url}',
+ },
+ title: {
+ id: 'auth.authorize.authorize-app-name',
+ defaultMessage: 'Authorize {appName}',
+ },
+})
+
const data = useNuxtApp()
const router = useRoute()
@@ -143,11 +191,11 @@ const onAuthorize = async () => {
return
}
- throw new Error('No redirect location found in response')
+ throw new Error(formatMessage(messages.noRedirectUrlError))
} catch (error) {
data.$notify({
group: 'main',
- title: 'An error occurred',
+ title: formatMessage(commonMessages.errorNotificationTitle),
text: err.data ? err.data.description : err,
type: 'error',
})
@@ -170,11 +218,11 @@ const onReject = async () => {
return
}
- throw new Error('No redirect location found in response')
+ throw new Error(formatMessage(messages.noRedirectUrlError))
} catch (error) {
data.$notify({
group: 'main',
- title: 'An error occurred',
+ title: formatMessage(commonMessages.errorNotificationTitle),
text: err.data ? err.data.description : err,
type: 'error',
})
diff --git a/utils/common-messages.ts b/utils/common-messages.ts
index e2658b4dd..70c6ebdd2 100644
--- a/utils/common-messages.ts
+++ b/utils/common-messages.ts
@@ -35,6 +35,10 @@ export const commonMessages = defineMessages({
id: 'button.edit',
defaultMessage: 'Edit',
},
+ errorLabel: {
+ id: 'label.error',
+ defaultMessage: 'Error',
+ },
errorNotificationTitle: {
id: 'notification.error.title',
defaultMessage: 'An error occurred',