mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
(@hapi/nes) fix: add reauthenticate method (#37072)
* fix: add reauthenticate method * fix: add test * Update types/hapi__nes/lib/client.d.ts Co-Authored-By: Rodrigo Saboya <saboya@users.noreply.github.com>
This commit is contained in:
parent
5e51687559
commit
87f5dc0c2e
1
types/hapi__nes/lib/client.d.ts
vendored
1
types/hapi__nes/lib/client.d.ts
vendored
@ -22,6 +22,7 @@ declare class Client {
|
||||
unsubscribe(path: string, handler?: Client.Handler): Promise<any>;
|
||||
subscriptions(): string[];
|
||||
overrideReconnectionAuth(auth: any): void;
|
||||
reauthenticate(auth: any): Promise<true>;
|
||||
}
|
||||
|
||||
declare namespace Client {
|
||||
|
||||
@ -15,5 +15,8 @@ import NesClient = require('@hapi/nes/lib/client');
|
||||
var client = new NesClient.Client('ws://localhost');
|
||||
client.connect({ auth: { headers: { authorization: 'Basic am9objpzZWNyZXQ=' } } }).then(() => {
|
||||
|
||||
return client.reauthenticate({ headers: { authorization: 'Bearer am9objpzZWNyZXQ=' } });
|
||||
}).then(() => {
|
||||
|
||||
return client.request('hello');
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user