From 840b59fcba2a9fbadc37fb3ecf0c8aee67dd992c Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Wed, 14 Jul 2021 01:15:04 -0500 Subject: [PATCH] Fixed a silent login callback error and reworked project structure. --- Props/client/.eslintrc.js | 62 +++++++++---------- .../public/authentication/callback-handler.js | 13 ---- ...silent-login-callback.html => silent.html} | 6 +- Props/client/src/{ => index}/App.vue | 0 .../src/{ => index}/components/InfoCard.vue | 0 .../{ => index}/components/ProfileDisplay.vue | 4 +- .../{ => index}/components/ProfileLogIn.vue | 0 .../{ => index}/components/ProfileLogOut.vue | 0 .../{ => index}/components/ProfileSignUp.vue | 0 .../src/{ => index}/components/SearchBar.vue | 0 .../src/{ => index}/components/WaitCircle.vue | 0 Props/client/src/{ => index}/main.js | 4 +- .../src/{ => index}/registerServiceWorker.js | 0 Props/client/src/{ => index}/router/guards.js | 0 Props/client/src/{ => index}/router/index.js | 0 Props/client/src/{ => index}/router/routes.js | 0 .../client/src/{ => index}/store/identity.js | 8 +-- Props/client/src/{ => index}/store/index.js | 0 Props/client/src/{ => index}/views/About.vue | 0 .../src/{ => index}/views/Authentication.vue | 6 +- Props/client/src/{ => index}/views/Home.vue | 2 +- Props/client/src/silent/main.js | 12 ++++ Props/client/vue.config.js | 6 +- Props/server/Startup.cs | 12 ++-- 24 files changed, 72 insertions(+), 63 deletions(-) delete mode 100644 Props/client/public/authentication/callback-handler.js rename Props/client/public/{authentication/silent-login-callback.html => silent.html} (68%) rename Props/client/src/{ => index}/App.vue (100%) rename Props/client/src/{ => index}/components/InfoCard.vue (100%) rename Props/client/src/{ => index}/components/ProfileDisplay.vue (92%) rename Props/client/src/{ => index}/components/ProfileLogIn.vue (100%) rename Props/client/src/{ => index}/components/ProfileLogOut.vue (100%) rename Props/client/src/{ => index}/components/ProfileSignUp.vue (100%) rename Props/client/src/{ => index}/components/SearchBar.vue (100%) rename Props/client/src/{ => index}/components/WaitCircle.vue (100%) rename Props/client/src/{ => index}/main.js (65%) rename Props/client/src/{ => index}/registerServiceWorker.js (100%) rename Props/client/src/{ => index}/router/guards.js (100%) rename Props/client/src/{ => index}/router/index.js (100%) rename Props/client/src/{ => index}/router/routes.js (100%) rename Props/client/src/{ => index}/store/identity.js (96%) rename Props/client/src/{ => index}/store/index.js (100%) rename Props/client/src/{ => index}/views/About.vue (100%) rename Props/client/src/{ => index}/views/Authentication.vue (94%) rename Props/client/src/{ => index}/views/Home.vue (99%) create mode 100644 Props/client/src/silent/main.js diff --git a/Props/client/.eslintrc.js b/Props/client/.eslintrc.js index df848b6..71857fb 100644 --- a/Props/client/.eslintrc.js +++ b/Props/client/.eslintrc.js @@ -1,33 +1,33 @@ module.exports = { - root: true, - env: { - node: true - }, - extends: [ - 'plugin:vue/vue3-essential', - '@vue/standard' - ], - parserOptions: { - parser: 'babel-eslint' - }, - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', - 'quotes': ['error', 'double', 'avoid-escape'], - 'semi': ['error', 'always'], - 'indent': ['error', 4], - 'comma-dangle': ['error', 'only-multiline'], - 'space-before-function-paren': ['error', 'never'] - }, - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)' - ], - env: { - mocha: true - } - } - ] + root: true, + env: { + node: true + }, + extends: [ + 'plugin:vue/vue3-essential', + '@vue/standard' + ], + parserOptions: { + parser: 'babel-eslint' + }, + rules: { + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'quotes': ['error', 'double', 'avoid-escape'], + 'semi': ['error', 'always'], + 'indent': ['error', 4, { "SwitchCase": 1 }], + 'comma-dangle': ['error', 'only-multiline'], + 'space-before-function-paren': ['error', 'never'] + }, + overrides: [ + { + files: [ + '**/__tests__/*.{j,t}s?(x)', + '**/tests/unit/**/*.spec.{j,t}s?(x)' + ], + env: { + mocha: true + } + } + ] } diff --git a/Props/client/public/authentication/callback-handler.js b/Props/client/public/authentication/callback-handler.js deleted file mode 100644 index e47465c..0000000 --- a/Props/client/public/authentication/callback-handler.js +++ /dev/null @@ -1,13 +0,0 @@ -import { UserManager, WebStorageStateStore } from "oidc-client"; - -const userManager = new UserManager({ - authority: window.location.origin, - client_id: "Props", - 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/Props/client/public/authentication/silent-login-callback.html b/Props/client/public/silent.html similarity index 68% rename from Props/client/public/authentication/silent-login-callback.html rename to Props/client/public/silent.html index ab400a1..458f773 100644 --- a/Props/client/public/authentication/silent-login-callback.html +++ b/Props/client/public/silent.html @@ -1,16 +1,18 @@ + authentication - +
- Silently authenticating user. If you are seeing this page, you probably want to go back to the app. + Processing... If you're seeing this, you may want to go back to the app.
+ \ No newline at end of file diff --git a/Props/client/src/App.vue b/Props/client/src/index/App.vue similarity index 100% rename from Props/client/src/App.vue rename to Props/client/src/index/App.vue diff --git a/Props/client/src/components/InfoCard.vue b/Props/client/src/index/components/InfoCard.vue similarity index 100% rename from Props/client/src/components/InfoCard.vue rename to Props/client/src/index/components/InfoCard.vue diff --git a/Props/client/src/components/ProfileDisplay.vue b/Props/client/src/index/components/ProfileDisplay.vue similarity index 92% rename from Props/client/src/components/ProfileDisplay.vue rename to Props/client/src/index/components/ProfileDisplay.vue index ef8f544..fde641f 100644 --- a/Props/client/src/components/ProfileDisplay.vue +++ b/Props/client/src/index/components/ProfileDisplay.vue @@ -13,7 +13,7 @@