mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-27 22:38:10 +09:00
make secure check
This commit is contained in:
parent
f4861e9dc5
commit
ecc0397dd3
@ -151,11 +151,14 @@ mastoRouter.post("/oauth/token", async (ctx) => {
|
||||
const BASE_URL = `${ctx.request.protocol}://${ctx.request.hostname}`;
|
||||
const generator = (megalodon as any).default;
|
||||
const client = generator("misskey", BASE_URL, null) as MegalodonInterface;
|
||||
const m = body.code.match(/^[a-zA-Z0-9-]+/);
|
||||
if (!m.length) {
|
||||
ctx.body = { error: "Invalid code" };
|
||||
return;
|
||||
}
|
||||
let m = null;
|
||||
if (body.code) {
|
||||
m = body.code.match(/^[a-zA-Z0-9-]+/);
|
||||
if (!m.length) {
|
||||
ctx.body = { error: "Invalid code" };
|
||||
return;
|
||||
}
|
||||
}
|
||||
try {
|
||||
const atData = await client.fetchAccessToken(
|
||||
null,
|
||||
|
Loading…
Reference in New Issue
Block a user