Skip to content

Instantly share code, notes, and snippets.

@groovecoder
Created October 8, 2019 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save groovecoder/6396fdf9604bb465e9ac3d23d445915d to your computer and use it in GitHub Desktop.
Save groovecoder/6396fdf9604bb465e9ac3d23d445915d to your computer and use it in GitHub Desktop.
const crypto = require("crypto");
const express = require("express");
const app = express();
const port = 3000;
app.get("/browser/oauth/state", (req, res) => {
console.log("state token request");
const state = crypto.randomBytes(32).toString("hex");
res.status(201).json({
status: "ok",
state_token: state,
});
});
app.post("/browser/oauth/authenticate", (req, res) => {
console.log("authenticate request just returns 200 and json");
res.status(200).json({
status: "ok",
profile_data: {
email: "test@example.com"
},
tiers_enabled: false,
proxy_token: null,
current_pass: -1,
total_passes: -1,
});
});
app.post("/browser/oauth/info", (req, res) => {
console.log("info request");
res.status(200).json({
status: "ok",
});
});
app.post("/browser/oauth/token", (req, res) => {
console.log("info request");
res.status(201).json({
status: "ok",
profile_data: {
email: "test@example.com"
},
tiers_enabled: false,
proxy_token: { received_at: ""},
current_pass: -1,
total_passes: -1,
});
});
app.post("/browser/oauth/forget", (req, res) => {
console.log("forget request");
res.status(200).json({
status: "ok",
});
});
app.listen(port, () => console.log(`App listening on ${port}`));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment