forked from jriou/coller
feat: Add copier and curl links
Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
2d8d7efbcb
commit
b316c6ef67
4 changed files with 77 additions and 3 deletions
|
@ -213,8 +213,14 @@ func (h *GetProtectedNoteHandler) ServeHTTP(w http.ResponseWriter, r *http.Reque
|
|||
}
|
||||
}
|
||||
|
||||
password, err := internal.Decode(body.Password)
|
||||
if err != nil {
|
||||
APIError(w, logger, ErrCouldNotDecodePassword, err)
|
||||
return
|
||||
}
|
||||
|
||||
if len(note.PasswordHash) > 0 {
|
||||
err := bcrypt.CompareHashAndPassword(note.PasswordHash, []byte(body.Password))
|
||||
err := bcrypt.CompareHashAndPassword(note.PasswordHash, password)
|
||||
if err != nil {
|
||||
APIErrorBadRequest(w, logger, ErrInvalidPassword, err)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue