He doesn't call the object method $user->redirect_to_login, but the subroutine GWAK::User->redirect_to_login which should work even when the creation of the $user object failed.
Aside from this, it would be very helpful if the relevant parts of the GWAK module were provided here.
Correct, but then he is using the method 'errstr' which I guess should return an error string, which must fail, cause it was not populated with a value. So at least it could return 'undef', does it?
Have a nice day All decision is left to your taste