Start Mock Server
Loading "Github Sign in Callback"
Github Sign in Callback
Run locally for transcripts
π¨βπΌ We're going to test our "Login with GitHub" integration. We've already
implemented the HTTP mocks in . But
we're not actually loading those mocks yet. So we need you to update the tests
to load and start the mocks server.
Additionally, we're going to have you create the request and call the loader.
You may want to review the loader
in . You'll
notice it expects a few things on the request object. Here's a quick summary of
what's required:
- The
request.urlshould behttps://www.epicstack.dev/auth/github/callback - search param called
state(can just be a random string) - search param called
code(can just be a random string) - A header called
cookiewhich includes thesessionStoragewithoauth2:stateset to the same value as thestatesearch param. - Method
GET
π§ββοΈ Because
sessionStorage.commitSession() returns a set-cookie header for a
response, and you need a cookie header for a request, I've made a utility for
you that does the conversion for you. You'll find it at the bottom of the test
file. It's called convertSetCookieToCookie.npx vitest auth.\$provider