mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
fix(server): remove default auth redirect url (#8140)
This commit is contained in:
@@ -138,8 +138,7 @@ export class AuthController {
|
||||
res: Response,
|
||||
email: string,
|
||||
callbackUrl = '/magic-link',
|
||||
|
||||
redirectUrl = this.url.home
|
||||
redirectUrl?: string
|
||||
) {
|
||||
// send email magic link
|
||||
const user = await this.user.findUserByEmail(email);
|
||||
@@ -155,7 +154,11 @@ export class AuthController {
|
||||
const magicLink = this.url.link(callbackUrl, {
|
||||
token,
|
||||
email,
|
||||
redirect_uri: redirectUrl,
|
||||
...(redirectUrl
|
||||
? {
|
||||
redirect_uri: redirectUrl,
|
||||
}
|
||||
: {}),
|
||||
});
|
||||
|
||||
const result = await this.auth.sendSignInEmail(email, magicLink, !user);
|
||||
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
OauthAccountAlreadyConnected,
|
||||
OauthStateExpired,
|
||||
UnknownOauthProvider,
|
||||
URLHelper,
|
||||
} from '../../fundamentals';
|
||||
import { OAuthProviderName } from './config';
|
||||
import { OAuthAccount, Tokens } from './providers/def';
|
||||
@@ -31,7 +30,6 @@ export class OAuthController {
|
||||
private readonly auth: AuthService,
|
||||
private readonly oauth: OAuthService,
|
||||
private readonly user: UserService,
|
||||
private readonly url: URLHelper,
|
||||
private readonly providerFactory: OAuthProviderFactory,
|
||||
private readonly db: PrismaClient
|
||||
) {}
|
||||
@@ -41,7 +39,7 @@ export class OAuthController {
|
||||
@HttpCode(HttpStatus.OK)
|
||||
async preflight(
|
||||
@Body('provider') unknownProviderName?: string,
|
||||
@Body('redirect_uri') redirectUri: string = this.url.home
|
||||
@Body('redirect_uri') redirectUri?: string
|
||||
) {
|
||||
if (!unknownProviderName) {
|
||||
throw new MissingOauthQueryParameter({ name: 'provider' });
|
||||
|
||||
Reference in New Issue
Block a user