Skip to content

Commit e09f9b1

Browse files
committed
Remove redundant error check
1 parent c60bfb3 commit e09f9b1

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

authentication/cookie.go

+1-13
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
package authentication
22

33
import (
4-
"errors"
5-
"net/http"
6-
7-
"github.com/getsentry/sentry-go"
84
"github.com/gin-gonic/gin"
9-
"github.com/google/logger"
105
"github.com/partyoffice/spotifete/database/model"
116
)
127

@@ -30,14 +25,7 @@ func GetValidSessionFromCookie(c *gin.Context) *model.LoginSession {
3025

3126
func GetSessionIdFromCookie(c *gin.Context) *string {
3227
sessionId, err := c.Cookie(sessionCookieName)
33-
if err != nil {
34-
if !errors.As(err, &http.ErrNoCookie) {
35-
logger.Error("Could not get error from context", err)
36-
sentry.CaptureException(err)
37-
}
38-
39-
return nil
40-
} else if sessionId == "" {
28+
if err != nil || sessionId == "" {
4129
return nil
4230
}
4331

0 commit comments

Comments
 (0)