Compare commits
2 Commits
9b82fa7828
...
b77bebe3b1
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | b77bebe3b1 | |
Derrick Hammer | 86380c7b3a |
|
@ -156,6 +156,10 @@ func (f *FilesController) PostPinBy(cidString string) {
|
||||||
f.Ctx.StatusCode(iris.StatusCreated)
|
f.Ctx.StatusCode(iris.StatusCreated)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (f *FilesController) GetUploadLimit() {
|
||||||
|
f.respondJSON(&response.UploadLimit{Limit: f.Ctx.Application().ConfigurationReadOnly().GetPostMaxMemory()})
|
||||||
|
}
|
||||||
|
|
||||||
func validateCid(cidString string, validateStatus bool, ctx iris.Context) (string, bool) {
|
func validateCid(cidString string, validateStatus bool, ctx iris.Context) (string, bool) {
|
||||||
_, err := cid.Valid(cidString)
|
_, err := cid.Valid(cidString)
|
||||||
if sendError(ctx, err, iris.StatusBadRequest) {
|
if sendError(ctx, err, iris.StatusBadRequest) {
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
package response
|
||||||
|
|
||||||
|
type UploadLimit struct {
|
||||||
|
Limit int64 `json:"limit"`
|
||||||
|
}
|
|
@ -254,7 +254,7 @@ func VerifyLoginToken(token string) (*model.Account, error) {
|
||||||
return nil, ErrInvalidToken
|
return nil, ErrInvalidToken
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = jwt.Verify(jwt.HS256, jwtKey, []byte(token), blocklist)
|
_, err = jwt.Verify(jwt.EdDSA, jwtKey, []byte(token), blocklist)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
db.Get().Delete(&session)
|
db.Get().Delete(&session)
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue