MCPcopy
hub / github.com/freeCodeCamp/freeCodeCamp / devAuth

Function devAuth

api/src/plugins/auth-dev.ts:32–48  ·  view source on GitHub ↗
(
  fastify,
  _options,
  done
)

Source from the content-addressed store, hash-verified

30 * @param done - The callback function.
31 */
32export const devAuth: FastifyPluginCallbackTypebox = (
33 fastify,
34 _options,
35 done
36) => {
37 fastify.get('/signin', async (req, reply) => {
38 const email = 'foo@bar.com';
39
40 const { id } = await findOrCreateUser(fastify, email);
41
42 reply.setAccessTokenCookie(createAccessToken(id));
43
44 await handleRedirects(req, reply);
45 });
46
47 done();
48};

Callers

nothing calls this directly

Calls 4

findOrCreateUserFunction · 0.85
createAccessTokenFunction · 0.85
handleRedirectsFunction · 0.85
doneFunction · 0.85

Tested by

no test coverage detected