(req, res, next)
| 131 | * @param next {Function} - Express middleware function |
| 132 | */ |
| 133 | const 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 |
nothing calls this directly
no outgoing calls
no test coverage detected