How to fix error "User is unauthorized" when i use models

Closing as duplicate thread.