title: Identity Server: Redirect after login and logout in Angular?
body: <p>I use IdentityServer in an Angular project based on .NET Core and I use the Identity Server razor login page by modifying it. Except from this login page, I use Angular pages and redirect the related pages using lazy-loading feature in Angular.</p>
  <p>However, I need some different scenarios for after login and logout as explained below:</p>
  <p><strong>1.</strong> After user login, I want to redirect a specific page. How can I set this page? In the IdentityServer action methods, or in the login button's onClick action? I can also use href via a hperlink?</p>
  <p><strong>2.</strong> Should I use an <code>ActionLink</code>, etc as the login page is razor by redirecting the page to a Controller and then open an Angular page? Or is it better to use a href or routerlink property for the login button and call the related Angular route easily?</p>
  <p><strong>3.</strong> For the logout, I want to redirect an Angular page. Should I set it in the logout or logout callback properties of IdentityServer configuration?</p>
  <p>Any help would be appreciated.</p>
  <p><strong>Update:</strong> Here is the constant file that can be used for redirect or callback setup:</p>
  <pre><code>export const LogoutActions = {
    LogoutCallback: 'logout-callback',
    Logout: 'logout',
    LoggedOut: 'logged-out'
  };
  
  export const LoginActions = {
    Login: 'login',
    LoginCallback: 'login-callback',
    LoginFailed: 'login-failed',
    Profile: 'profile',
    Register: 'register'
  };
  
  let applicationPaths: ApplicationPathsType = {
    DefaultLoginRedirectPath: '/',
    ApiAuthorizationClientConfigurationUrl: `/_configuration/${ApplicationName}`,
    Login: `authentication/${LoginActions.Login}`,
    LoginFailed: `authentication/${LoginActions.LoginFailed}`,
    LoginCallback: `authentication/${LoginActions.LoginCallback}`,
    Register: `authentication/${LoginActions.Register}`,
    Profile: `authentication/${LoginActions.Profile}`,
    LogOut: `authentication/${LogoutActions.Logout}`,
    LoggedOut: `authentication/${LogoutActions.LoggedOut}`,
    LogOutCallback: `authentication/${LogoutActions.LogoutCallback}`,
    LoginPathComponents: [],
    LoginFailedPathComponents: [],
    LoginCallbackPathComponents: [],
    RegisterPathComponents: [],
    ProfilePathComponents: [],
    LogOutPathComponents: [],
    LoggedOutPathComponents: [],
    LogOutCallbackPathComponents: [],
    IdentityRegisterPath: '/Identity/Account/Register',
    IdentityManagePath: '/Identity/Account/Manage'
  };
  
  applicationPaths = {
    ...applicationPaths,
    LoginPathComponents: applicationPaths.Login.split('/'),
    LoginFailedPathComponents: applicationPaths.LoginFailed.split('/'),
    RegisterPathComponents: applicationPaths.Register.split('/'),
    ProfilePathComponents: applicationPaths.Profile.split('/'),
    LogOutPathComponents: applicationPaths.LogOut.split('/'),
    LoggedOutPathComponents: applicationPaths.LoggedOut.split('/'),
    LogOutCallbackPathComponents: applicationPaths.LogOutCallback.split('/')
  };
  </code></pre>