Check if user is student or teacher. If invalid role, auto logout and require login again