Skip to content

Commit

Permalink
🔥 Remove unused params in authcore api init
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Aug 10, 2020
1 parent 16c572d commit 052ba57
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/models/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ export class Environment {
}
}

async setupAuthCore(refreshToken?: string, accessToken?: string) {
async setupAuthCore() {
const {
COSMOS_CHAIN_ID,
AUTHCORE_ROOT_URL,
} = this.appConfig.getAllParams()
await this.authCoreAPI.setup(AUTHCORE_ROOT_URL, COSMOS_CHAIN_ID, refreshToken, accessToken)
await this.authCoreAPI.setup(AUTHCORE_ROOT_URL, COSMOS_CHAIN_ID)
}

/**
Expand Down
4 changes: 2 additions & 2 deletions app/models/root-store/setup-root-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export async function setupRootStore() {
rootStore = createRootStore(env, data)

// Setup Authcore
await env.setupAuthCore()
env.setupAuthCore()
if (rootStore.userStore.currentUser) {
await rootStore.userStore.authCore.resume()
const address = rootStore.userStore.authCore.primaryCosmosAddress
Expand All @@ -103,7 +103,7 @@ export async function setupRootStore() {
logError(e.message)

rootStore = createRootStore(env)
await env.setupAuthCore()
env.setupAuthCore()
}

// reactotron logging
Expand Down
5 changes: 1 addition & 4 deletions app/services/authcore/authcore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,14 @@ export class AuthCoreAPI {
*/
callbacks: AuthCoreCallback = {}

async setup(baseURL: string, cosmosChainId: string, refreshToken?: string, accessToken?: string) {
setup(baseURL: string, cosmosChainId: string, refreshToken?: string, accessToken?: string) {
this.baseURL = baseURL
this.client = new AuthCore({
baseUrl: baseURL,
socialLoginPaneStyle: "top",
language: findBestAvailableLanguage(),
})
this.cosmosChainId = cosmosChainId
if (refreshToken) {
await this.setupModules(refreshToken, accessToken)
}
}

async setupModules(refreshToken: string, accessToken?: string) {
Expand Down

0 comments on commit 052ba57

Please sign in to comment.