refactor code

This commit is contained in:
stremovsky
2019-12-17 18:26:17 +02:00
parent e3e950b9e6
commit 735d02ad8a
7 changed files with 31 additions and 35 deletions

View File

@@ -116,7 +116,7 @@ func (dbobj dbcon) generateUserLoginXToken(userTOKEN string) (string, error) {
return tokenUUID, nil
}
func (dbobj dbcon) checkToken(tokenUUID string) bool {
func (dbobj dbcon) checkXtoken(tokenUUID string) bool {
//fmt.Printf("Token0 %s\n", tokenUUID)
if isValidUUID(tokenUUID) == false {
return false
@@ -153,7 +153,7 @@ func (dbobj dbcon) checkUserAuthXToken(xtokenUUID string) (tokenAuthResult, erro
// tokenType = temp
now := int32(time.Now().Unix())
if now > record["endtime"].(int32) {
return result, errors.New("token expired")
return result, errors.New("xtoken expired")
}
result.token = record["token"].(string)
if value, ok := record["fields"]; ok {