From d39e835c7e52c0cdaf8b0fd8d2ae10863cceb8db Mon Sep 17 00:00:00 2001 From: Alex Blumgart Date: Mon, 8 Jul 2024 18:39:25 +0300 Subject: [PATCH 01/12] feat: add yandex oauth --- README.md | 1 + playground/.env.example | 3 + playground/app.vue | 276 ++++---- playground/auth.d.ts | 43 +- playground/nuxt.config.ts | 17 +- playground/package.json | 3 + playground/server/routes/auth/yandex.get.ts | 12 + pnpm-lock.yaml | 701 ++++++++++++++++++-- src/module.ts | 208 +++--- src/runtime/server/lib/oauth/yandex.ts | 141 ++++ src/runtime/server/utils/oauth.ts | 36 +- 11 files changed, 1100 insertions(+), 341 deletions(-) create mode 100644 playground/server/routes/auth/yandex.get.ts create mode 100644 src/runtime/server/lib/oauth/yandex.ts 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 0a08dde7..3ae897dc 100644 --- a/playground/app.vue +++ b/playground/app.vue @@ -1,142 +1,148 @@