revert: deletion of oauth.pug

This commit is contained in:
Mar0xy 2023-11-09 15:06:57 +01:00
parent fdb36f1d96
commit 885800ee5e
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
2 changed files with 20 additions and 0 deletions

View file

@ -78,6 +78,17 @@ export class OAuth2ProviderService {
);
});
fastify.get('/oauth/authorize/', async (request, reply) => {
const query: any = request.query;
let param = "mastodon=true";
if (query.state) param += `&state=${query.state}`;
if (query.redirect_uri) param += `&redirect_uri=${query.redirect_uri}`;
const client = query.client_id ? query.client_id : "";
reply.redirect(
`${Buffer.from(client.toString(), 'base64').toString()}?${param}`,
);
});
fastify.post('/oauth/token', async (request, reply) => {
const body: any = request.body || request.query;
if (body.grant_type === "client_credentials") {

View file

@ -0,0 +1,9 @@
extends ./base
block meta
//- Should be removed by the page when it loads, so that it won't needlessly
//- stay when user navigates away via the navigation bar
//- XXX: Remove navigation bar in auth page?
meta(name='misskey:oauth:transaction-id' content=transactionId)
meta(name='misskey:oauth:client-name' content=clientName)
meta(name='misskey:oauth:scope' content=scope)