Skip to content

Commit

Permalink
feat(pages): add oauth
Browse files Browse the repository at this point in the history
Resolves #260
  • Loading branch information
dargmuesli committed Apr 25, 2023
1 parent f67049e commit e27abee
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 65 deletions.
3 changes: 2 additions & 1 deletion nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
"test:integration:docker:prod": "pnpm test:integration:docker:br pnpm test:integration:prod"
},
"devDependencies": {
"@dargmuesli/nuxt-vio": "1.8.3",
"@dargmuesli/nuxt-vio": "1.10.3",
"@intlify/eslint-plugin-vue-i18n": "2.0.0",
"@nuxtjs/eslint-config-typescript": "12.0.0",
"@types/node": "18.16.0",
"clipboardy": "3.0.0",
"consola": "3.1.0",
"cross-env": "7.0.3",
"cypress": "12.10.0",
Expand Down
49 changes: 49 additions & 0 deletions nuxt/pages/oauth.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<template>
<div v-if="typeof route.query.code === 'string'" class="flex flex-col">
<span class="break-words">
{{ route.query.code }}
</span>
<VioButton :aria-label="t('copy')" class="border" @click="copy">
{{ t('copy') }}
</VioButton>
</div>
</template>

<script setup lang="ts">
import clipboard from 'clipboardy'
definePageMeta({
middleware: [
(to) => {
const localePath = useLocalePath()
if (!to.query.code) {
return navigateTo(localePath('/'))
}
},
],
})
const route = useRoute()
const { t } = useI18n()
// methods
const copy = async () => {
if (typeof route.query.code !== 'string') return
await clipboard.write(route.query.code)
showToast({ title: t('copySuccess') })
}
// initialization
useSeoMeta({ title: 'OAuth' })
</script>

<i18n lang="yaml">
de:
copy: Kopieren
copySuccess: In die Zwischenablage kopiert
en:
copy: Copy
copySuccess: Copied to the clipboard
</i18n>
87 changes: 23 additions & 64 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e27abee

Please sign in to comment.