Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Commit

Permalink
GH Action Standards
Browse files Browse the repository at this point in the history
  • Loading branch information
confused-Techie authored and github-actions[bot] committed Dec 16, 2022
1 parent 031ba08 commit bfb0deb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/handlers/oauth_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ async function getOauth(req, res) {
create_user.content.token = access_token;

// Now we redirect to the frontend site.
res.redirect(`https://web.pulsar-edit.dev/users?token=${create_user.content.token}`);
res.redirect(
`https://web.pulsar-edit.dev/users?token=${create_user.content.token}`
);
logger.httpLog(req, res);
} catch (err) {
logger.generic(2, "/api/oauth Caught an Error!", {
Expand Down Expand Up @@ -257,7 +259,9 @@ async function getPat(req, res) {
create_user.content.token = params.token;

// Now we redirect to the frontend site
res.redirect(`https://web.pulsar-edit.dev/users?token=${create_user.content.token}`);
res.redirect(
`https://web.pulsar-edit.dev/users?token=${create_user.content.token}`
);
logger.httpLog(req, res);
} catch (err) {
logger.generic(2, "/api/pat Caught an Error!", { type: "error", err: err });
Expand Down
10 changes: 8 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -832,15 +832,21 @@ app.get("/api/users/:login/stars", genericLimit, async (req, res) => {
*/
app.get("/api/users", authLimit, async (req, res) => {
res.header("Access-Control-Allow-Methods", "GET");
res.header("Access-Control-Allow-Headers", "Content-Type, Authorization, Access-Control-Allow-Credentials");
res.header(
"Access-Control-Allow-Headers",
"Content-Type, Authorization, Access-Control-Allow-Credentials"
);
res.header("Access-Control-Allow-Origin", "https://web.pulsar-edit.dev");
res.header("Access-Control-Allow-Credentials", true);
await user_handler.getAuthUser(req, res);
});

app.options("/api/users", async (req, res) => {
res.header("Access-Control-Allow-Methods", "GET");
res.header("Access-Control-Allow-Headers", "Content-Type, Authorization, Access-Control-Allow-Credentials");
res.header(
"Access-Control-Allow-Headers",
"Content-Type, Authorization, Access-Control-Allow-Credentials"
);
res.header("Access-Control-Allow-Origin", "https://web.pulsar-edit.dev");
res.header("Access-Control-Allow-Credentials", true);
res.send(200);
Expand Down
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ class StateStore {
);
return {
ok: true,
content: state
content: state,
};
// The design here is flawed. Essentially it seems that because we are behind a load balancer
// the process here needs to retain the stateStore, but there's no guarantee that
Expand Down

0 comments on commit bfb0deb

Please sign in to comment.