Created
October 8, 2019 22:49
-
-
Save groovecoder/6396fdf9604bb465e9ac3d23d445915d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "[email protected]" | |
}, | |
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: "[email protected]" | |
}, | |
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