Directly redirect to login page instead of welcome page with login button


#1

I was following the sample here https://github.com/okta/samples-js-react/tree/master/okta-hosted-login.
In my application I need this to be implemented in another way, that is when user hits the url it should directly take the browser to the okta login page, instead of showing the

welcome, click to login

page.

What changes are needed in the above example to make that work?

P.S: New to this as well as React.


#2

How are you creating your users?


#3

Which URL do you want this to happen on?


#4

That’d be my app url.
Instead of seeing “click to login” page, I want the login page to be redirected to.

So I did this:

{!this.state.authenticated &&
  this.login()
}

and that solves it.