Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): fix login error #741

Merged
merged 2 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
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
8 changes: 3 additions & 5 deletions cli/src/action/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import { getEmoji } from "../../util/print"


export async function login(pat, options) {
let remoteServer = options.remote || DEFAULT_REMOTE_SERVER

let systemConfig: SystemConfig = {
remoteServer: DEFAULT_REMOTE_SERVER,
remoteServer: remoteServer,
}
writeSystemConfig(systemConfig)

Expand All @@ -21,10 +22,7 @@ export async function login(pat, options) {
token: token,
tokenExpire: timestamp + TOKEN_EXPIRE,
pat: pat,
remoteServer: DEFAULT_REMOTE_SERVER,
}
if (options.remote) {
systemConfig.remoteServer = options.remote
remoteServer: remoteServer,
}
writeSystemConfig(systemConfig)
console.log(`${getEmoji('🎉')} login success`)
Expand Down
2 changes: 1 addition & 1 deletion cli/src/common/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const DEBUG_TOKEN_EXPIRE = 3600 * 24 * 7
export const STORAGE_TOKEN_EXPIRE = 3600 * 24 * 7

// remote server config
export const DEFAULT_REMOTE_SERVER = 'http://api.dev.laf.run'
export const DEFAULT_REMOTE_SERVER = 'http://api.preview.laf.run'

// template file
export const TEMPLATE_DIR = 'template'
Expand Down