MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / login

Method login

lib/models/dav.js:10728–10758  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10726 this.accountType = (_b = params.defaultAccountType) !== null && _b !== void 0 ? _b : 'caldav';
10727 }
10728 async login() {
10729 var _a;
10730 switch (this.authMethod) {
10731 case 'Basic':
10732 this.authHeaders = getBasicAuthHeaders(this.credentials);
10733 break;
10734 case 'Oauth':
10735 this.authHeaders = (await getOauthHeaders(this.credentials)).headers;
10736 break;
10737 case 'Digest':
10738 this.authHeaders = {
10739 Authorization: `Digest ${this.credentials.digestString}`,
10740 };
10741 break;
10742 case 'Custom':
10743 this.authHeaders = await ((_a = this.authFunction) === null || _a === void 0 ? void 0 : _a.call(this, this.credentials));
10744 break;
10745 default:
10746 throw new Error('Invalid auth method');
10747 }
10748 this.account = this.accountType
10749 ? await createAccount({
10750 account: {
10751 serverUrl: this.serverUrl,
10752 credentials: this.credentials,
10753 accountType: this.accountType,
10754 },
10755 headers: this.authHeaders,
10756 })
10757 : undefined;
10758 }
10759 async davRequest(params0) {
10760 const { init, ...rest } = params0;
10761 const { headers, ...restInit } = init;

Callers

nothing calls this directly

Calls 3

getBasicAuthHeadersFunction · 0.85
getOauthHeadersFunction · 0.85
createAccountFunction · 0.85

Tested by

no test coverage detected