{"action":"closed","issue":{"url":"https://api.github.com/repos/ahopkins/sanic-jwt/issues/97","repository_url":"https://api.github.com/repos/ahopkins/sanic-jwt","labels_url":"https://api.github.com/repos/ahopkins/sanic-jwt/issues/97/labels{/name}","comments_url":"https://api.github.com/repos/ahopkins/sanic-jwt/issues/97/comments","events_url":"https://api.github.com/repos/ahopkins/sanic-jwt/issues/97/events","html_url":"https://github.com/ahopkins/sanic-jwt/issues/97","id":316001536,"number":97,"title":"Override / Implement your own endpoints","user":{"login":"vltr","id":1540275,"avatar_url":"https://avatars2.githubusercontent.com/u/1540275?v=4","gravatar_id":"","url":"https://api.github.com/users/vltr","html_url":"https://github.com/vltr","followers_url":"https://api.github.com/users/vltr/followers","following_url":"https://api.github.com/users/vltr/following{/other_user}","gists_url":"https://api.github.com/users/vltr/gists{/gist_id}","starred_url":"https://api.github.com/users/vltr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vltr/subscriptions","organizations_url":"https://api.github.com/users/vltr/orgs","repos_url":"https://api.github.com/users/vltr/repos","events_url":"https://api.github.com/users/vltr/events{/privacy}","received_events_url":"https://api.github.com/users/vltr/received_events","type":"User","site_admin":false},"labels":[{"id":662876817,"url":"https://api.github.com/repos/ahopkins/sanic-jwt/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":{"login":"vltr","id":1540275,"avatar_url":"https://avatars2.githubusercontent.com/u/1540275?v=4","gravatar_id":"","url":"https://api.github.com/users/vltr","html_url":"https://github.com/vltr","followers_url":"https://api.github.com/users/vltr/followers","following_url":"https://api.github.com/users/vltr/following{/other_user}","gists_url":"https://api.github.com/users/vltr/gists{/gist_id}","starred_url":"https://api.github.com/users/vltr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vltr/subscriptions","organizations_url":"https://api.github.com/users/vltr/orgs","repos_url":"https://api.github.com/users/vltr/repos","events_url":"https://api.github.com/users/vltr/events{/privacy}","received_events_url":"https://api.github.com/users/vltr/received_events","type":"User","site_admin":false},"assignees":[{"login":"vltr","id":1540275,"avatar_url":"https://avatars2.githubusercontent.com/u/1540275?v=4","gravatar_id":"","url":"https://api.github.com/users/vltr","html_url":"https://github.com/vltr","followers_url":"https://api.github.com/users/vltr/followers","following_url":"https://api.github.com/users/vltr/following{/other_user}","gists_url":"https://api.github.com/users/vltr/gists{/gist_id}","starred_url":"https://api.github.com/users/vltr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vltr/subscriptions","organizations_url":"https://api.github.com/users/vltr/orgs","repos_url":"https://api.github.com/users/vltr/repos","events_url":"https://api.github.com/users/vltr/events{/privacy}","received_events_url":"https://api.github.com/users/vltr/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/ahopkins/sanic-jwt/milestones/2","html_url":"https://github.com/ahopkins/sanic-jwt/milestone/2","labels_url":"https://api.github.com/repos/ahopkins/sanic-jwt/milestones/2/labels","id":3196952,"number":2,"title":"v1.1","description":"","creator":{"login":"ahopkins","id":166269,"avatar_url":"https://avatars1.githubusercontent.com/u/166269?v=4","gravatar_id":"","url":"https://api.github.com/users/ahopkins","html_url":"https://github.com/ahopkins","followers_url":"https://api.github.com/users/ahopkins/followers","following_url":"https://api.github.com/users/ahopkins/following{/other_user}","gists_url":"https://api.github.com/users/ahopkins/gists{/gist_id}","starred_url":"https://api.github.com/users/ahopkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahopkins/subscriptions","organizations_url":"https://api.github.com/users/ahopkins/orgs","repos_url":"https://api.github.com/users/ahopkins/repos","events_url":"https://api.github.com/users/ahopkins/events{/privacy}","received_events_url":"https://api.github.com/users/ahopkins/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":8,"state":"open","created_at":"2018-03-19T07:36:58Z","updated_at":"2018-05-27T21:34:39Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2018-04-19T19:02:37Z","updated_at":"2018-05-27T21:34:39Z","closed_at":"2018-05-27T21:34:39Z","author_association":"COLLABORATOR","body":"Enable developers to implement their own endpoints (like `/auth`, `/auth/me`, `/auth/verify`, etc) if they want by subclassing `BaseEndpoint` ...\r\n\r\n```python\r\nclass MyAuthenticateEndpoint(BaseEndpoint):\r\n\r\n    async def post(self, request, *args, **kwargs):\r\n        # do your override here\r\n        return json(my_return)\r\n```\r\n\r\n... and inserting into `Initialize` as kwargs:\r\n\r\n```python\r\napp = Sanic()\r\nInitialize(\r\n    app,\r\n    authenticate_endpoint=MyAuthenticateEndpoint)\r\n```\r\n\r\nOr adding into a `Configuration` subclass:\r\n\r\n```\r\nclass MyConfig(Configuration):\r\n    authenticate_endpoint = MyAuthenticateEndpoint\r\n\r\napp = Sanic()\r\nInitialize(app, configuration_class=MyConfig)\r\n```\r\n\r\nRemembering, there endpoints *should* subclass `BaseEndpoint`."}}
{"actor":{"display_login":"ahopkins"}}