mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-25 19:37:34 -07:00
[backend] Cleanup oauth debug logging
This commit is contained in:
parent
0611651409
commit
37b5a8d71d
1 changed files with 1 additions and 8 deletions
|
@ -136,6 +136,7 @@ router.get("/identicon/:x", async (ctx) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//TODO: move these to auth.ts
|
||||||
mastoRouter.get("/oauth/authorize", async (ctx) => {
|
mastoRouter.get("/oauth/authorize", async (ctx) => {
|
||||||
const { client_id, state, redirect_uri } = ctx.request.query;
|
const { client_id, state, redirect_uri } = ctx.request.query;
|
||||||
console.log(ctx.request.req);
|
console.log(ctx.request.req);
|
||||||
|
@ -163,13 +164,6 @@ mastoRouter.post("/oauth/token", async (ctx) => {
|
||||||
}
|
}
|
||||||
let token = null;
|
let token = null;
|
||||||
if (body.code) {
|
if (body.code) {
|
||||||
//m = body.code.match(/^([a-zA-Z0-9]{8})([a-zA-Z0-9]{4})([a-zA-Z0-9]{4})([a-zA-Z0-9]{4})([a-zA-Z0-9]{12})/);
|
|
||||||
//if (!m.length) {
|
|
||||||
// ctx.body = { error: "Invalid code" };
|
|
||||||
// return;
|
|
||||||
//}
|
|
||||||
//token = `${m[1]}-${m[2]}-${m[3]}-${m[4]}-${m[5]}`
|
|
||||||
console.log(body.code, token);
|
|
||||||
token = body.code;
|
token = body.code;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -180,7 +174,6 @@ mastoRouter.post("/oauth/token", async (ctx) => {
|
||||||
scope: body.scope || "read write follow push",
|
scope: body.scope || "read write follow push",
|
||||||
created_at: Math.floor(new Date().getTime() / 1000),
|
created_at: Math.floor(new Date().getTime() / 1000),
|
||||||
};
|
};
|
||||||
console.log("token-response", ret);
|
|
||||||
ctx.body = ret;
|
ctx.body = ret;
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|
Loading…
Reference in a new issue