GitHub の OAuth 認証には GET https://github.com/login/oauth/authorize
に state
というランダムな値をとる引数があり、こちらが送った値とResponseが一致するかで CSRF対策として使えることを知った
#web-application-flow" rel="nofollow">https://docs.github.com/en/developers/apps/authorizing-oauth-apps#web-application-flow