mirror of
https://github.com/janishutz/oidclogin.git
synced 2026-10-08 17:26:20 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6fb820d6af |
@@ -112,6 +112,7 @@ func callbackHandler(c *gin.Context) {
|
|||||||
session.Delete("redirect")
|
session.Delete("redirect")
|
||||||
|
|
||||||
session.Set("jhid_auth", true)
|
session.Set("jhid_auth", true)
|
||||||
|
session.Set("jhid_uid", claims.Uid)
|
||||||
session.Save()
|
session.Save()
|
||||||
|
|
||||||
if redir != nil {
|
if redir != nil {
|
||||||
@@ -125,6 +126,8 @@ func EnsureLogin(redirectFail bool) func(c *gin.Context) {
|
|||||||
return (func(c *gin.Context) {
|
return (func(c *gin.Context) {
|
||||||
session := sessions.Default(c)
|
session := sessions.Default(c)
|
||||||
if session.Get("jhid_auth") == true {
|
if session.Get("jhid_auth") == true {
|
||||||
|
// Set the UID on the context
|
||||||
|
c.Set("uid", session.Get("jhid_uid").(string))
|
||||||
c.Next()
|
c.Next()
|
||||||
} else {
|
} else {
|
||||||
if redirectFail {
|
if redirectFail {
|
||||||
|
|||||||
Reference in new issue
Block a user