ngx-admin NbDummyAuthStrategy redirection after login

460 views Asked by At

I've been building an interface using Nebular's NbAuthModule and NbDummyAuthStrategy. I have found that when using NbPasswordAuthStrategy you can easily set a redirect on successful login, however when using NbDummyAuthStrategy it doesn't accept a redirect on a "successful" login. Nothing in the nebular documentation appears helpful in this regard.

Is there any way to redirect after login when using the NbDummyAuthStrategy?

NbDummyAuthStrategy.setup({
      name: "dummy",
      alwaysFail: false,
      token: {
        class: NbAuthSimpleToken,
      },

      \\ below doesn't work
      login: {
        redirect: {
          success: "/pages/dashboard",
          failure: "null, // stay on the same page
        },
      }
    }),
1

There are 1 answers

1
Jesuva Sj On

Try using the NbPasswordAuthStrategy or simply add the

redirect:{ success:'your-value',failure:'your-value'},

in the dummy-strategy-options.d.ts file