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

Disable TerminalUI sign in/out method (s) #2752

Merged
merged 1 commit into from
Oct 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions packages/expo-cli/src/commands/start/TerminalUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ const div = chalk.dim(`|`);
const printUsage = async (projectDir: string, options: Pick<StartOptions, 'webOnly'> = {}) => {
const { dev } = await ProjectSettings.readAsync(projectDir);
const openDevToolsAtStartup = await UserSettings.getAsync('openDevToolsAtStartup', true);
const username = await UserManager.getCurrentUsernameAsync();
const devMode = dev ? 'development' : 'production';
const currentAuth = `@${username}`;
const currentToggle = openDevToolsAtStartup ? 'disabled' : 'enabled';

const isMac = process.platform === 'darwin';
Expand All @@ -74,7 +72,6 @@ const printUsage = async (projectDir: string, options: Pick<StartOptions, 'webOn
['d', `open Expo DevTools`],
['shift+d', `toggle auto opening DevTools on startup`, currentToggle],
!options.webOnly && ['e', `share the app link by email`],
['s', username ? `sign out` : `sign in`, currentAuth],
];

log.nested(
Expand Down Expand Up @@ -107,7 +104,6 @@ export const printServerInfo = async (
return;
}
const url = await UrlUtils.constructManifestUrlAsync(projectDir);
const username = await UserManager.getCurrentUsernameAsync();
log.newLine();
log.nested(` ${u(url)}`);
log.newLine();
Expand All @@ -118,21 +114,9 @@ export const printServerInfo = async (
const iosInfo = process.platform === 'darwin' ? `, or ${b('i')} for iOS simulator` : '';
const webInfo = `${b`w`} to run on ${u`w`}eb`;
log.nested(wrap(u('To run the app with live reloading, choose one of:')));
if (username) {
log.nested(
item(
`Sign in as ${i(
'@' + username
)} in Expo client on Android or iOS. Your projects will automatically appear in the "Projects" tab.`
)
);
}
log.nested(item(`Scan the QR code above with the Expo app (Android) or the Camera app (iOS).`));
log.nested(item(`Press ${b`a`} for Android emulator${iosInfo}, or ${webInfo}.`));
log.nested(item(`Press ${b`e`} to send a link to your phone with email.`));
if (!username) {
log.nested(item(`Press ${b`s`} to sign in and enable more options.`));
}

Webpack.printConnectionInstructions(projectDir);
printHelp();
Expand Down Expand Up @@ -383,26 +367,6 @@ Please reload the project in the Expo app for the change to take effect.`
Project.startAsync(projectRoot, { ...options, reset });
break;
}
case 's': {
const authSession = await UserManager.getSessionAsync();
if (authSession?.accessToken) {
log(chalk.yellow('Please remove the EXPO_TOKEN environment var to sign out.'));
} else if (authSession?.sessionSecret) {
await UserManager.logoutAsync();
log('Signed out.');
} else {
stopWaitingForCommand();
try {
await loginOrRegisterIfLoggedOutAsync();
} catch (e) {
log.error(e);
} finally {
startWaitingForCommand();
}
}
printHelp();
break;
}
case 'o':
log('Trying to open the project in your editor...');
await startProjectInEditorAsync(projectRoot);
Expand Down