1

Below is the routing module, After clearing cache when I try to access page with direct url (locahost:4200/create) it is being redirected for microsoft token validation after successful token validation it's being redirected to home instead of requested URL which is 'create'

{
  path: '',
  loadChildren: () => import('src/home').then((m) => {
    return m.home;
  }),
},
{
  path: 'create',
  loadChildren: () => import('src/createpage').then((m) => {
    return m.createpage;
  }),
},

config file

auth: {
    clientId: 'clientID',
    authority: 'authority',
    // redirectUri: 'redirectUri'),
    redirectUri: window.location.origin,
    navigateToLoginRequestUrl: true,
    protectedResourceMap: 'protectedResourceMap',
    postLogoutRedirectUri: 'postLogoutRedirectUri'
},

I tried changing config in config file from home to window.location.origin and added navigateToLoginRequestUrl: true,

Below is the earlier config. In both cases it's not working

auth: {
    clientId: 'clientID',
    authority: 'authority',
    // redirectUri: 'redirectUri'),
    redirectUri: 'localhost:4200/home',
    navigateToLoginRequestUrl: true,
    protectedResourceMap: 'protectedResourceMap',
    postLogoutRedirectUri: 'postLogoutRedirectUri'
},
Gregory Boutte
  • 584
  • 6
  • 26

0 Answers0