MCPcopy Create free account
hub / github.com/RealDevSquad/website-backend / githubAuthLogin

Function githubAuthLogin

controllers/auth.js:133–147  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

131 * @param next {Function} - Express middleware function
132 */
133const githubAuthLogin = (req, res, next) => {
134 let { sourceUtm, redirectURL } = req.query;
135
136 const isMobileApp = sourceUtm === "rds-mobile-app";
137
138 if (isMobileApp) {
139 const newUrl = new URL(redirectURL);
140 newUrl.searchParams.set("isMobileApp", true);
141 redirectURL = newUrl.toString();
142 }
143 return passport.authenticate("github", {
144 scope: ["user:email"],
145 state: redirectURL,
146 })(req, res, next);
147};
148
149/**
150 * Fetches the user info from GitHub and authenticates User

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected