feat(backend/oauth): allow CORS for token endpoint (#12814)
* feat(backend/oauth): allow CORS for token endpoint * no need to explicitly set origin to `*` * Update CHANGELOG.md
This commit is contained in:
parent
c96bc36fed
commit
ad346b6f36
10 changed files with 242 additions and 48 deletions
|
@ -16,6 +16,7 @@ import * as Acct from '@/misc/acct.js';
|
|||
import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { NodeinfoServerService } from './NodeinfoServerService.js';
|
||||
import { OAuth2ProviderService } from './oauth/OAuth2ProviderService.js';
|
||||
import type { FindOptionsWhere } from 'typeorm';
|
||||
import type { FastifyInstance, FastifyPluginOptions } from 'fastify';
|
||||
|
||||
|
@ -30,6 +31,7 @@ export class WellKnownServerService {
|
|||
|
||||
private nodeinfoServerService: NodeinfoServerService,
|
||||
private userEntityService: UserEntityService,
|
||||
private oauth2ProviderService: OAuth2ProviderService,
|
||||
) {
|
||||
//this.createServer = this.createServer.bind(this);
|
||||
}
|
||||
|
@ -87,6 +89,10 @@ export class WellKnownServerService {
|
|||
return { links: this.nodeinfoServerService.getLinks() };
|
||||
});
|
||||
|
||||
fastify.get('/.well-known/oauth-authorization-server', async () => {
|
||||
return this.oauth2ProviderService.generateRFC8414();
|
||||
});
|
||||
|
||||
/* TODO
|
||||
fastify.get('/.well-known/change-password', async (request, reply) => {
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue