mirror of
https://github.com/pushbits/server.git
synced 2025-05-12 16:37:02 +02:00
Add option to enforce strict compatibility
Some plugins check for token length. Since PushBits uses longer tokens by default for better security, these plugins are incompatible. With this patch, users can decide if they want an application to have a short token, so that said plugins can talk to PushBits again.
This commit is contained in:
parent
fb90808288
commit
d7721e827b
8 changed files with 106 additions and 30 deletions
|
@ -19,6 +19,9 @@ func successOrAbort(ctx *gin.Context, code int, err error) bool {
|
|||
|
||||
func isCurrentUser(ctx *gin.Context, ID uint) bool {
|
||||
user := authentication.GetUser(ctx)
|
||||
if user == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
if user.ID != ID {
|
||||
ctx.AbortWithError(http.StatusForbidden, errors.New("only owner can delete application"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue