mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
fix: missing authenticator (#6526)
This commit is contained in:
parent
44ee058730
commit
f7a81858ea
@ -11,6 +11,7 @@ import { Cache } from '@nocobase/cache';
|
||||
import { Model } from '@nocobase/database';
|
||||
import { InstallOptions, Plugin } from '@nocobase/server';
|
||||
import { tval } from '@nocobase/utils';
|
||||
import { tokenPolicyCollectionName, tokenPolicyRecordKey } from '../constants';
|
||||
import { namespace, presetAuthType, presetAuthenticator } from '../preset';
|
||||
import authActions from './actions/auth';
|
||||
import authenticatorsActions from './actions/authenticators';
|
||||
@ -19,7 +20,6 @@ import { AuthModel } from './model/authenticator';
|
||||
import { Storer } from './storer';
|
||||
import { TokenBlacklistService } from './token-blacklist';
|
||||
import { TokenController } from './token-controller';
|
||||
import { tokenPolicyCollectionName, tokenPolicyRecordKey } from '../constants';
|
||||
|
||||
export class PluginAuthServer extends Plugin {
|
||||
cache: Cache;
|
||||
@ -139,7 +139,7 @@ export class PluginAuthServer extends Plugin {
|
||||
});
|
||||
|
||||
this.app.on('ws:message:auth:token', async ({ clientId, payload }) => {
|
||||
if (!payload || !payload.token || !payload.authenticator) {
|
||||
if (!payload || !payload.token) {
|
||||
this.app.emit(`ws:removeTag`, {
|
||||
clientId,
|
||||
tagKey: 'userId',
|
||||
@ -147,7 +147,7 @@ export class PluginAuthServer extends Plugin {
|
||||
return;
|
||||
}
|
||||
|
||||
const auth = await this.app.authManager.get(payload.authenticator, {
|
||||
const auth = await this.app.authManager.get(payload.authenticator || 'basic', {
|
||||
getBearerToken: () => payload.token,
|
||||
app: this.app,
|
||||
db: this.app.db,
|
||||
|
Loading…
x
Reference in New Issue
Block a user