TuitioAuthenticationResult type
parent
6b3385af6a
commit
8b28ec10eb
|
@ -22,6 +22,9 @@ async function request(url: string, method: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type TuitioToken = { raw: string; validFrom: Date; validUntil: Date };
|
||||||
|
export type TuitioAuthenticationResult = { token: TuitioToken; status: string };
|
||||||
|
|
||||||
class TuitioClient {
|
class TuitioClient {
|
||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
|
|
||||||
|
@ -29,7 +32,7 @@ class TuitioClient {
|
||||||
this.baseUrl = baseUrl;
|
this.baseUrl = baseUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
async authenticate(userName: string, password: string) {
|
async authenticate(userName: string, password: string): Promise<TuitioAuthenticationResult> {
|
||||||
const templates = getUrlTemplates(this.baseUrl);
|
const templates = getUrlTemplates(this.baseUrl);
|
||||||
const url = templates.authentication.replace("{username}", userName).replace("{password}", password);
|
const url = templates.authentication.replace("{username}", userName).replace("{password}", password);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue