Skip to content

Commit

Permalink
Create a new /blank page which does what it says on the tin...nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
bcspragu committed Oct 4, 2023
1 parent 5930dea commit 822dcd5
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/composables/useMSAL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export const useMSAL = async (): Promise<MSAL> => {
const signOut = async (): Promise<void> => {
const logoutRequest = {
postLogoutRedirectUri: msalConfig.auth.redirectUri,
mainWindowRedirectUri: msalConfig.auth.redirectUri
mainWindowRedirectUri: msalConfig.auth.logoutUri
}
const userClient = userClientWithCustomToken('') // Logging out doesn't require auth.
try {
Expand Down
4 changes: 3 additions & 1 deletion frontend/envs/env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ MSAL_USER_FLOW_NAME=B2C_1_susi_dev
MSAL_USER_FLOW_AUTHORITY=https://rmiauthdev.b2clogin.com/rmiauthdev.onmicrosoft.com/B2C_1_susi_dev
MSAL_AUTHORITY_DOMAIN=rmiauthdev.b2clogin.com
MSAL_CLIENT_ID=218f47ee-11b1-459a-b914-b7fa6f107e7b
MSAL_REDIRECT_URI=https://pacta.dev.rmi.siliconally.dev
# See https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/initialization.md#redirecturi-considerations
MSAL_REDIRECT_URI=https://pacta.dev.rmi.siliconally.dev/blank
MSAL_LOGOUT_URI=https://pacta.dev.rmi.siliconally.dev/
4 changes: 3 additions & 1 deletion frontend/envs/env.local
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ MSAL_USER_FLOW_NAME=B2C_1_susi_local
MSAL_USER_FLOW_AUTHORITY=https://rmiauthlocal.b2clogin.com/rmiauthlocal.onmicrosoft.com/B2C_1_susi_local
MSAL_AUTHORITY_DOMAIN=rmiauthlocal.b2clogin.com
MSAL_CLIENT_ID=2d77a4a9-b7be-4451-ad47-c151d8b6c05f
MSAL_REDIRECT_URI=http://localhost:3000
# See https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/initialization.md#redirecturi-considerations
MSAL_REDIRECT_URI=http://localhost:3000/blank
MSAL_LOGOUT_URI=http://localhost:3000/
3 changes: 3 additions & 0 deletions frontend/layouts/empty.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template>
<NuxtPage />
</template>
3 changes: 2 additions & 1 deletion frontend/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export default defineNuxtConfig({
userFlowAuthority: process.env.MSAL_USER_FLOW_AUTHORITY ?? '',
authorityDomain: process.env.MSAL_AUTHORITY_DOMAIN ?? '',
clientID: process.env.MSAL_CLIENT_ID ?? '',
redirectURI: process.env.MSAL_REDIRECT_URI ?? ''
redirectURI: process.env.MSAL_REDIRECT_URI ?? '',
logoutURI: process.env.MSAL_LOGOUT_URI ?? '',
}
}
},
Expand Down
11 changes: 11 additions & 0 deletions frontend/pages/blank.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script setup lang="ts">
// This page is used as a redirect URI for our popup login flow, see
// https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/initialization.md#redirecturi-considerations
definePageMeta({
layout: 'empty'
})
</script>

<template>
</template>
6 changes: 4 additions & 2 deletions frontend/plugins/msal.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export default defineNuxtPlugin((_nuxtApp) => {
userFlowAuthority,
authorityDomain,
clientID,
redirectURI
redirectURI,
logoutURI,
}
}
} = useRuntimeConfig()
Expand All @@ -31,7 +32,8 @@ export default defineNuxtPlugin((_nuxtApp) => {
clientId: clientID,
authority: b2cPolicies.authorities.signUpSignIn.authority, // Choose sign-up/sign-in user-flow as your default.
knownAuthorities: [b2cPolicies.authorityDomain], // You must identify your tenant's domain as a known authority.
redirectUri: redirectURI // Must be registered as a SPA redirectURI on your app registration
redirectUri: redirectURI, // Must be registered as a SPA redirectURI on your app registration
logoutUri: logoutURI,
},
cache: {
cacheLocation: 'localStorage',
Expand Down

0 comments on commit 822dcd5

Please sign in to comment.