add output for storing token and username
This commit is contained in:
@@ -59,11 +59,13 @@ export default class User {
|
|||||||
public setUsernameToLocal(username: string) {
|
public setUsernameToLocal(username: string) {
|
||||||
this.context.globalState.update(this.usernameKey, username);
|
this.context.globalState.update(this.usernameKey, username);
|
||||||
this.username = username;
|
this.username = username;
|
||||||
|
console.log('Username has been stored.')
|
||||||
}
|
}
|
||||||
|
|
||||||
public setUserTokenToLocal(userToken: string) {
|
public setUserTokenToLocal(userToken: string) {
|
||||||
this.context.globalState.update(this.userTokenKey, userToken)
|
this.context.globalState.update(this.userTokenKey, userToken)
|
||||||
this.userToken = userToken
|
this.userToken = userToken
|
||||||
|
console.log('Token has been stored.');
|
||||||
}
|
}
|
||||||
|
|
||||||
public getUserPrivateKeyPath(): string {
|
public getUserPrivateKeyPath(): string {
|
||||||
@@ -134,6 +136,7 @@ export default class User {
|
|||||||
await fs.writeFileSync(this.getUserPrivateKeyPath(), privateKeyStr);
|
await fs.writeFileSync(this.getUserPrivateKeyPath(), privateKeyStr);
|
||||||
// limit the permission of private key to prevent that the private key not works
|
// limit the permission of private key to prevent that the private key not works
|
||||||
await fs.chmodSync(this.getUserPrivateKeyPath(), 0o600)
|
await fs.chmodSync(this.getUserPrivateKeyPath(), 0o600)
|
||||||
|
console.log(`User's ssh key has been created.`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to write public/private key into the default ssh public/key file: ", error);
|
console.error("Failed to write public/private key into the default ssh public/key file: ", error);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user