Skip to content

Commit

Permalink
Use feedbacks from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
nono committed Dec 5, 2023
1 parent ec9537d commit 84dc60b
Show file tree
Hide file tree
Showing 7 changed files with 666 additions and 661 deletions.
2 changes: 1 addition & 1 deletion assets/locales/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ msgid "Install flagship app Skip"
msgstr "Continue in the browser"

msgid "Share by link Password Title"
msgstr "Fill the password to access the link"
msgstr "Enter the password to access the link"

msgid "Share by link Password Field"
msgstr "Password"
Expand Down
2 changes: 1 addition & 1 deletion assets/locales/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ msgid "Install flagship app Skip"
msgstr "Continue in the browser"

msgid "Share by link Password Title"
msgstr "Fill the password to access the link"
msgstr "Enter the password to access the link"

msgid "Share by link Password Field"
msgstr "Password"
Expand Down
2 changes: 1 addition & 1 deletion assets/locales/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ msgid "Install flagship app Skip"
msgstr "Continue in the browser"

msgid "Share by link Password Title"
msgstr "Fill the password to access the link"
msgstr "Enter the password to access the link"

msgid "Share by link Password Field"
msgstr "Password"
Expand Down
2 changes: 1 addition & 1 deletion assets/locales/ja.po
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ msgid "Install flagship app Skip"
msgstr "Continue in the browser"

msgid "Share by link Password Title"
msgstr "Fill the password to access the link"
msgstr "Enter the password to access the link"

msgid "Share by link Password Field"
msgstr "Password"
Expand Down
2 changes: 1 addition & 1 deletion assets/locales/nl_NL.po
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ msgid "Install flagship app Skip"
msgstr "Continue in the browser"

msgid "Share by link Password Title"
msgstr "Fill the password to access the link"
msgstr "Enter the password to access the link"

msgid "Share by link Password Field"
msgstr "Password"
Expand Down
5 changes: 5 additions & 0 deletions web/auth/share_by_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package auth

import (
"encoding/base64"
"errors"
"net/http"

"github.com/cozy/cozy-stack/model/permission"
"github.com/cozy/cozy-stack/model/session"
build "github.com/cozy/cozy-stack/pkg/config"
"github.com/cozy/cozy-stack/pkg/couchdb"
"github.com/cozy/cozy-stack/pkg/crypto"
"github.com/cozy/cozy-stack/web/middlewares"
"github.com/labstack/echo/v4"
Expand All @@ -25,6 +27,9 @@ func checkPasswordForShareByLink(c echo.Context) error {
permID := c.FormValue("perm_id")
perm, err := permission.GetByID(inst, permID)
if err != nil {
if couchdb.IsNotFoundError(err) || errors.Is(err, permission.ErrExpiredToken) {
return c.JSON(http.StatusNotFound, echo.Map{"error": err.Error()})
}
return c.JSON(http.StatusInternalServerError, echo.Map{"error": err.Error()})
}

Expand Down
1,312 changes: 656 additions & 656 deletions web/statik/statik.go

Large diffs are not rendered by default.

0 comments on commit 84dc60b

Please sign in to comment.