Protected
actionProtected
messageProtected
repliesReadonly
tokenProtected
transportReadonly
transporterOptional
usernameProtected
onThe connection process is only finished when this method resolves and doesn't throw. When an error is thrown, the authentication was unsuccessful.
If you use controllers in this callback, make sure to use dontWaitForConnection=true, otherwise you get an endless loop.
async onAuthenticate(): Promise<void> {
const auth = this.controller<AuthController>('auth', {dontWaitForConnection: true});
const result = auth.login('username', 'password');
if (!result) throw new AuthenticationError('Authentication failed);
}
Protected
onProtected
onOptional
body: TOptional
schema: ReceiveType<T>Optional
connectionOptional
dontOptional
peerOptional
timeout?: numberGenerated using TypeDoc
Per default entity types with a name (@entity.name()) will be reused. If a entity with a given name was not loaded and error is thrown. This to ensure nominal typing (object instanceof T). Use this method to disable this behavior and construct new nominal types if an entity is not loaded.