Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

[cli] add support back for owner field when cred checking #1941

Merged
merged 6 commits into from
Apr 25, 2020
Prev Previous commit
Next Next commit
add debug log in context for clarity
  • Loading branch information
quinlanj committed Apr 24, 2020
commit 6f249d58acf62cd61b8abd8f51872df1cd641c31
6 changes: 6 additions & 0 deletions packages/expo-cli/src/credentials/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ApiV2, Doctor, User, UserManager } from '@expo/xdl';

import { AppleCtx, authenticate } from '../appleApi';
import { IosApi } from './api';
import log from '../log';

export interface IView {
open(ctx: Context): Promise<IView | null>;
Expand Down Expand Up @@ -77,6 +78,11 @@ export class Context {
this._manifest = exp;
this._hasProjectContext = true;
this._iosApiClient = new IosApi(this.user).withProjectContext(this);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could use some more context on what's going on here - why do create an api client if the status is fatal? and why not with the project context?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i updated this with better comments -- basically we use Doctor.validateWithoutNetworkAsync to check whether there is a manifest in the project directory. If there is (we get a non fatal response), we initialize the necesary project context things, else we do a normal initialization

log(
`Configuring credentials for ${this.manifest.owner ?? this.user.username} in project ${
this.manifest.slug
}`
);
} else {
/* This manager does not need to work in project context */
this._iosApiClient = new IosApi(this.user);
Expand Down