Skip to content

Commit

Permalink
create auth() func for checking user auth
Browse files Browse the repository at this point in the history
  • Loading branch information
ErfiDev committed Dec 1, 2021
1 parent 48e5368 commit d01fef8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions utils/auth.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package utils

import "net/http"

func IsAuthenticated(req *http.Request) bool {
exists := appConfig.Session.Exists(req.Context() , "user_id")

return exists
}

0 comments on commit d01fef8

Please sign in to comment.