Function : authDirect

The authDirect() function is used to redirect to another page if the current user session is active.

Assuming we have to write a test code as below
  if( isUser() ) {

    redirect('some-url');

  }
                  
We can easily run this in one line with authDirect() as shown below
  authDirect('some-url');