From c597d65256a572c750531d72675112eb74fdf686 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Mon, 12 Jul 2021 03:06:13 -0500 Subject: [PATCH] Added sign up button and improved logout flow. Also added proper link to profile management. --- .../public/authentication/callback-handler.js | 13 +++++ .../authentication/silent-login-callback.html | 16 ++++++ MultiShop/client/src/App.vue | 9 ++- .../client/src/components/ProfileDisplay.vue | 10 ++-- .../client/src/components/ProfileLogIn.vue | 4 +- .../client/src/components/ProfileLogOut.vue | 2 +- .../client/src/components/ProfileSignUp.vue | 21 +++++++ .../client/src/services/authentication.js | 11 +++- MultiShop/client/src/store/identity.js | 57 +++++++++++++++---- MultiShop/client/src/views/Authentication.vue | 7 ++- MultiShop/server/Startup.cs | 4 +- 11 files changed, 127 insertions(+), 27 deletions(-) create mode 100644 MultiShop/client/public/authentication/callback-handler.js create mode 100644 MultiShop/client/public/authentication/silent-login-callback.html create mode 100644 MultiShop/client/src/components/ProfileSignUp.vue diff --git a/MultiShop/client/public/authentication/callback-handler.js b/MultiShop/client/public/authentication/callback-handler.js new file mode 100644 index 0000000..6fc0d8f --- /dev/null +++ b/MultiShop/client/public/authentication/callback-handler.js @@ -0,0 +1,13 @@ +import { UserManager, WebStorageStateStore } from "oidc-client"; + +const userManager = new UserManager({ + authority: window.location.origin, + client_id: "MultiShop", + redirect_uri: window.location.origin + "/authentication/login-callback", + post_logout_redirect_uri: window.location.origin + "/authentication/logout-callback", + response_type: "code", + scope: "openid profile", + userStore: new WebStorageStateStore({ store: window.localStorage }), +}); + +userManager.signinSilentCallback(); diff --git a/MultiShop/client/public/authentication/silent-login-callback.html b/MultiShop/client/public/authentication/silent-login-callback.html new file mode 100644 index 0000000..ab400a1 --- /dev/null +++ b/MultiShop/client/public/authentication/silent-login-callback.html @@ -0,0 +1,16 @@ + + + + + + + + authentication + + + +
+ Silently authenticating user. If you are seeing this page, you probably want to go back to the app. +
+ + \ No newline at end of file diff --git a/MultiShop/client/src/App.vue b/MultiShop/client/src/App.vue index dc9de7f..1ae8c14 100644 --- a/MultiShop/client/src/App.vue +++ b/MultiShop/client/src/App.vue @@ -35,6 +35,10 @@ +