mirror of https://github.com/Xhofe/alist
				
				
				
			fix(session): Fixed the session status update logic. (#9296)
- Removed the error returned when the session status is `SessionInactive`. - Updated the `LastActive` field of the session to always record the current time.pull/9299/head
							parent
							
								
									de09ba08b6
								
							
						
					
					
						commit
						3bf0af1e68
					
				|  | @ -25,11 +25,9 @@ func Handle(userID uint, deviceKey, ua, ip string) error { | |||
| 	now := time.Now().Unix() | ||||
| 	sess, err := db.GetSession(userID, deviceKey) | ||||
| 	if err == nil { | ||||
| 		if sess.Status == model.SessionInactive { | ||||
| 			return errors.WithStack(errs.SessionInactive) | ||||
| 		} | ||||
| 		sess.LastActive = now | ||||
| 		// reactivate existing session if it was inactive
 | ||||
| 		sess.Status = model.SessionActive | ||||
| 		sess.LastActive = now | ||||
| 		sess.UserAgent = ua | ||||
| 		sess.IP = ip | ||||
| 		return db.UpsertSession(sess) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 千石
						千石