revert islogged function check token validation and clean expired tokens
This commit is contained in:
		@@ -32,12 +32,12 @@ export default class User {
 | 
				
			|||||||
    this.devstarHostname = parsedUrl.hostname.replace(/\./g, '_'); //提取hostname,并用下划线替换.
 | 
					    this.devstarHostname = parsedUrl.hostname.replace(/\./g, '_'); //提取hostname,并用下划线替换.
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  public async login(token: string, username: string): Promise<string> {
 | 
					  public async login(token: string, username: string) {
 | 
				
			||||||
    const devstarAPIHandler = new DevstarAPIHandler()
 | 
					    const devstarAPIHandler = new DevstarAPIHandler()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
      const res = await devstarAPIHandler.verifyToken(token, username)
 | 
					      const res = await devstarAPIHandler.verifyToken(token, username)
 | 
				
			||||||
      if (res !== 'ok') {
 | 
					      if (!res) {
 | 
				
			||||||
        throw new Error('Token verification failed')
 | 
					        throw new Error('Token verification failed')
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user