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