Skip to content

Commit

Permalink
Merge pull request #25 from lemoncloud-io/feature/louis-update-init-s…
Browse files Browse the repository at this point in the history
…torage

Feature/louis update init storage
  • Loading branch information
louis-lemon authored Jun 11, 2024
2 parents 93dd3a3 + 5653596 commit 11cc5c3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/core/aws-web.core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export class AWSWebCore implements WebCoreService {
* @throws {Error} - Throws an error if there is no cached token.
*/
async init(): Promise<AWSWebCoreState> {
await this.tokenStorage.initLemonConfig();
const hasCachedToken = await this.tokenStorage.hasCachedToken();
if (!hasCachedToken) {
this.logger.warn('initialized without token!');
Expand Down Expand Up @@ -72,6 +73,15 @@ export class AWSWebCore implements WebCoreService {
return 'build';
}

/**
* Retrieves the token storage service.
*
* @returns {AWSStorageService} - The storage service that manages OAuth tokens.
*/
getTokenStorage(): AWSStorageService {
return this.tokenStorage;
}

/**
* Builds a request using HttpRequestBuilder without Credentials.
* @param {AxiosRequestConfig} config - The Axios request configuration.
Expand Down
9 changes: 9 additions & 0 deletions src/core/azure-web.core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ export class AzureWebCore implements WebCoreService {
return 'has-token';
}

/**
* Retrieves the token storage service.
*
* @returns {AzureStorageService} - The storage service that manages OAuth tokens.
*/
getTokenStorage(): AzureStorageService {
return this.tokenStorage;
}

/**
* Builds a request using HttpRequestBuilder without Credentials.
* @param {AxiosRequestConfig} config - The Axios request configuration.
Expand Down
1 change: 0 additions & 1 deletion src/token-storage/aws-storage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export class AWSStorageService extends TokenStorageService {

constructor(readonly config: WebCoreConfig<'aws'>) {
super(config);
this.initLemonConfig().then(() => {});
}

async initLemonConfig() {
Expand Down

0 comments on commit 11cc5c3

Please sign in to comment.