Shares: Allow reuse of the same share slugs & tokens #776
This commit is contained in:
parent
0c5e00dba7
commit
bbd0af3dd3
2 changed files with 2 additions and 2 deletions
|
@ -39,7 +39,7 @@ func Shares(router *gin.RouterGroup) {
|
|||
|
||||
links := entity.FindValidLinks(token, share)
|
||||
|
||||
if len(links) != 1 {
|
||||
if len(links) < 1 {
|
||||
log.Warn("share: invalid token or share")
|
||||
c.Redirect(http.StatusTemporaryRedirect, "/")
|
||||
return
|
||||
|
|
|
@ -168,7 +168,7 @@ func FindLinks(token, share string) (result Links) {
|
|||
}
|
||||
}
|
||||
|
||||
if err := q.Find(&result).Error; err != nil {
|
||||
if err := q.Order("modified_at DESC").Find(&result).Error; err != nil {
|
||||
log.Errorf("link: %s (not found)", err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue