implemented `auth_check` (#2497)
* check auth
* doc string
* Refactor auth_check
* make style & quality
* Docstring
* change gate test, expect value and delete duplicate code
* raise error
* Apply suggestions from code review
* style
---------
Co-authored-by: Celina Hanouti <hanouticelina@gmail.com>
Co-authored-by: Lucain <lucainp@gmail.com>