Modified require_login decorator.