認証の修正 (#7597)
* authenticateのキャッシュを廃止 * 凍結ユーザーがサインイン出来てしまうのを修正 * 凍結ユーザーはストリーミング接続出来ないように * 他人のアクセストークンはrevoke出来ないように, 正常削除を待機するように * ユーザー/アクセストークンを無効化したらストリーミングを切断するように * Revert TODO * ストリーミングterminateは、ユーザー削除後に行うように * signinでsuspendは別のエラーにする * トークン再生成後のストリーミング切断は少し待つように * サスペンド後のストリーミング切断はローカルユーザーのみに
This commit is contained in:
parent
62dede02ea
commit
04e27e160e
8 changed files with 41 additions and 15 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import $ from 'cafy';
|
||||
import * as bcrypt from 'bcryptjs';
|
||||
import { publishMainStream } from '../../../../services/stream';
|
||||
import { publishMainStream, publishUserEvent } from '../../../../services/stream';
|
||||
import generateUserToken from '../../common/generate-native-user-token';
|
||||
import define from '../../define';
|
||||
import { Users, UserProfiles } from '../../../../models';
|
||||
|
|
@ -36,4 +36,9 @@ export default define(meta, async (ps, user) => {
|
|||
|
||||
// Publish event
|
||||
publishMainStream(user.id, 'myTokenRegenerated');
|
||||
|
||||
// Terminate streaming
|
||||
setTimeout(() => {
|
||||
publishUserEvent(user.id, 'terminate', {});
|
||||
}, 5000);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue