Skip to content

Get state in checkAuth #289

@vmpj

Description

@vmpj

Currently in TestReactRouterRedirect a redirect is demonstrated and the state is stubbed.

export default class TestReactRouterRedirect extends BaseComponent {
  static checkAuth(nextState, replace) {
    // Hard code this to demonstrate the effect
    const notAuthorized = true;
    if (notAuthorized) {
      replace({ pathname: '/', state: { redirectFrom: nextState.location.pathname } });
    }
  }

What would be the react-on-rails way to access/get state at this point? I've tried a few approaches with no success. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions