From a7b7802422408aec2511b2d65a2ecfb69e16675b Mon Sep 17 00:00:00 2001 From: Marsel Shaikhin Date: Thu, 5 Sep 2024 18:36:55 +0200 Subject: [PATCH 1/4] enh: provide a demo implementation of refresh provider --- playground-local/app.vue | 4 +- playground-local/config/AuthRefreshHandler.ts | 17 ++++ playground-local/nuxt.config.ts | 14 +++- .../server/api/auth/login.post.ts | 80 ++++++++++++++++--- .../server/api/auth/refresh.post.ts | 76 ++++++++++++++++++ playground-local/server/api/auth/user.get.ts | 47 ++++++----- 6 files changed, 207 insertions(+), 31 deletions(-) create mode 100644 playground-local/config/AuthRefreshHandler.ts create mode 100644 playground-local/server/api/auth/refresh.post.ts diff --git a/playground-local/app.vue b/playground-local/app.vue index 6ccd27884..1f770a6f5 100644 --- a/playground-local/app.vue +++ b/playground-local/app.vue @@ -4,8 +4,8 @@ import { useAuth } from '#imports' const { signIn, token, refreshToken, data, status, lastRefreshedAt, signOut, getSession } = useAuth() -const username = ref('') -const password = ref('') +const username = ref('smith') +const password = ref('hunter2')