revert: deletion of oauth.pug
This commit is contained in:
parent
fdb36f1d96
commit
885800ee5e
2 changed files with 20 additions and 0 deletions
|
@ -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") {
|
||||
|
|
9
packages/backend/src/server/web/views/oauth.pug
Normal file
9
packages/backend/src/server/web/views/oauth.pug
Normal 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)
|
Loading…
Reference in a new issue