check login for post, put, delete method.