diff --git a/README.md b/README.md index b7b8acd8..8e99b43c 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,7 @@ It can also be set using environment variables: - Twitch - X (Twitter) - XSUAA +- Yandex You can add your favorite provider by creating a new file in [src/runtime/server/lib/oauth/](./src/runtime/server/lib/oauth/). diff --git a/playground/.env.example b/playground/.env.example index 072025b6..0eef7758 100644 --- a/playground/.env.example +++ b/playground/.env.example @@ -53,3 +53,6 @@ NUXT_OAUTH_X_CLIENT_SECRET= NUXT_OAUTH_XSUAA_CLIENT_ID= NUXT_OAUTH_XSUAA_CLIENT_SECRET= NUXT_OAUTH_XSUAA_DOMAIN= +# Yandex +NUXT_OAUTH_YANDEX_CLIENT_ID= +NUXT_OAUTH_YANDEX_CLIENT_SECRET= \ No newline at end of file diff --git a/playground/app.vue b/playground/app.vue index 0567a877..57655802 100644 --- a/playground/app.vue +++ b/playground/app.vue @@ -28,108 +28,116 @@ async function login() { logging.value = false } -const providers = computed(() => [ - { - label: session.value.user?.google || 'Google', - to: '/auth/google', - disabled: Boolean(user.value?.google), - icon: 'i-simple-icons-google', - }, - { - label: session.value.user?.facebook || 'Facebook', - to: '/auth/facebook', - disabled: Boolean(user.value?.facebook), - icon: 'i-simple-icons-facebook', - }, - { - label: session.value.user?.github || 'GitHub', - to: '/auth/github', - disabled: Boolean(user.value?.github), - icon: 'i-simple-icons-github', - }, - { - label: user.value?.linkedin || 'LinkedIn', - to: '/auth/linkedin', - disabled: Boolean(user.value?.linkedin), - icon: 'i-simple-icons-linkedin', - }, - { - label: user.value?.microsoft || 'Microsoft', - to: '/auth/microsoft', - disabled: Boolean(user.value?.microsoft), - icon: 'i-simple-icons-microsoft', - }, - { - label: user.value?.cognito || 'Cognito', - to: '/auth/cognito', - disabled: Boolean(user.value?.cognito), - icon: 'i-simple-icons-amazonaws', - }, - { - label: user.value?.discord || 'Discord', - to: '/auth/discord', - disabled: Boolean(user.value?.discord), - icon: 'i-simple-icons-discord', - }, - { - label: session.value.user?.spotify || 'Spotify', - to: '/auth/spotify', - disabled: Boolean(user.value?.spotify), - icon: 'i-simple-icons-spotify', - }, - { - label: session.value.user?.twitch || 'Twitch', - to: '/auth/twitch', - disabled: Boolean(user.value?.twitch), - icon: 'i-simple-icons-twitch', - }, - { - label: user.value?.auth0 || 'Auth0', - to: '/auth/auth0', - disabled: Boolean(user.value?.auth0), - icon: 'i-simple-icons-auth0', - }, - { - label: user.value?.battledotnet || 'Battle.net', - to: '/auth/battledotnet', - disabled: Boolean(user.value?.battledotnet), - icon: 'i-simple-icons-battledotnet', - }, - { - label: user.value?.keycloak || 'Keycloak', - to: '/auth/keycloak', - disabled: Boolean(user.value?.keycloak), - icon: 'i-simple-icons-redhat', - }, - { - label: session.value.user?.paypal || 'PayPal', - to: '/auth/paypal', - disabled: Boolean(user.value?.paypal), - icon: 'i-simple-icons-paypal', - }, - { - label: user.value?.steam || 'Steam', - to: '/auth/steam', - disabled: Boolean(user.value?.steam), - icon: 'i-simple-icons-steam', - }, - { - label: user.value?.x || 'X', - to: '/auth/x', - disabled: Boolean(user.value?.x), - icon: 'i-simple-icons-x', - }, - { - label: user.value?.xsuaa || 'XSUAA', - to: '/auth/xsuaa', - disabled: Boolean(user.value?.xsuaa), - icon: 'i-simple-icons-sap', - }, -].map(p => ({ - ...p, - prefetch: false, - external: true, -}))) +const providers = computed(() => + [ + { + label: session.value.user?.google || 'Google', + to: '/auth/google', + disabled: Boolean(user.value?.google), + icon: 'i-simple-icons-google', + }, + { + label: session.value.user?.facebook || 'Facebook', + to: '/auth/facebook', + disabled: Boolean(user.value?.facebook), + icon: 'i-simple-icons-facebook', + }, + { + label: session.value.user?.github || 'GitHub', + to: '/auth/github', + disabled: Boolean(user.value?.github), + icon: 'i-simple-icons-github', + }, + { + label: user.value?.linkedin || 'LinkedIn', + to: '/auth/linkedin', + disabled: Boolean(user.value?.linkedin), + icon: 'i-simple-icons-linkedin', + }, + { + label: user.value?.microsoft || 'Microsoft', + to: '/auth/microsoft', + disabled: Boolean(user.value?.microsoft), + icon: 'i-simple-icons-microsoft', + }, + { + label: user.value?.cognito || 'Cognito', + to: '/auth/cognito', + disabled: Boolean(user.value?.cognito), + icon: 'i-simple-icons-amazonaws', + }, + { + label: user.value?.discord || 'Discord', + to: '/auth/discord', + disabled: Boolean(user.value?.discord), + icon: 'i-simple-icons-discord', + }, + { + label: session.value.user?.spotify || 'Spotify', + to: '/auth/spotify', + disabled: Boolean(user.value?.spotify), + icon: 'i-simple-icons-spotify', + }, + { + label: session.value.user?.twitch || 'Twitch', + to: '/auth/twitch', + disabled: Boolean(user.value?.twitch), + icon: 'i-simple-icons-twitch', + }, + { + label: user.value?.auth0 || 'Auth0', + to: '/auth/auth0', + disabled: Boolean(user.value?.auth0), + icon: 'i-simple-icons-auth0', + }, + { + label: user.value?.battledotnet || 'Battle.net', + to: '/auth/battledotnet', + disabled: Boolean(user.value?.battledotnet), + icon: 'i-simple-icons-battledotnet', + }, + { + label: user.value?.keycloak || 'Keycloak', + to: '/auth/keycloak', + disabled: Boolean(user.value?.keycloak), + icon: 'i-simple-icons-redhat', + }, + { + label: session.value.user?.paypal || 'PayPal', + to: '/auth/paypal', + disabled: Boolean(user.value?.paypal), + icon: 'i-simple-icons-paypal', + }, + { + label: user.value?.steam || 'Steam', + to: '/auth/steam', + disabled: Boolean(user.value?.steam), + icon: 'i-simple-icons-steam', + }, + { + label: user.value?.x || 'X', + to: '/auth/x', + disabled: Boolean(user.value?.x), + icon: 'i-simple-icons-x', + }, + { + label: user.value?.xsuaa || 'XSUAA', + to: '/auth/xsuaa', + disabled: Boolean(user.value?.xsuaa), + icon: 'i-simple-icons-sap', + }, + { + label: user.value?.yandex || 'Yandex', + to: '/auth/yandex', + disabled: Boolean(user.value?.yandex), + icon: 'i-gravity-ui-logo-yandex', + }, + ].map(p => ({ + ...p, + prefetch: false, + external: true, + })), +)