Skip to content

Commit 1c091b1

Browse files
committed
Solution to redirection error when obtaining the access token.
1 parent 4c7d3f3 commit 1c091b1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/controllers/github.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,9 @@ exports.deleteAccount = GithubFactory.deleteOne();
3535

3636
exports.authCallback = catchAsync(async (req, res) => {
3737
const { accessToken, profile } = req.user;
38-
res.redirect(`${process.env.CLIENT_HOST}/github/authenticate/?accessToken=${accessToken}&profile=${JSON.stringify(profile)}`);
38+
// res.redirect just dont work... ???
39+
res.writeHead(302, {
40+
'Location': `${process.env.CLIENT_HOST}/github/authenticate/?accessToken=${accessToken}&profile=${JSON.stringify(profile)}`
41+
});
42+
res.end();
3943
});

0 commit comments

Comments
 (0)