Modified require login decorator.