Fix various issues
This commit is contained in:
parent
7579d35b4a
commit
5d3022f1cc
9
main.go
9
main.go
|
@ -8,7 +8,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"net/url"
|
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
@ -380,7 +379,7 @@ func main() {
|
||||||
|
|
||||||
conn.QueryRow("SELECT appId, rdiruri FROM oauth WHERE appId = ? LIMIT 1", appId).Scan(&appidcheck, &rdiruricheck)
|
conn.QueryRow("SELECT appId, rdiruri FROM oauth WHERE appId = ? LIMIT 1", appId).Scan(&appidcheck, &rdiruricheck)
|
||||||
|
|
||||||
if !(rdiruricheck == url.QueryEscape(redirect_uri)) {
|
if !(rdiruricheck == redirect_uri) {
|
||||||
c.String(401, "Redirect URI does not match")
|
c.String(401, "Redirect URI does not match")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -432,9 +431,9 @@ func main() {
|
||||||
|
|
||||||
var verifycode bool
|
var verifycode bool
|
||||||
if code_verify == "" {
|
if code_verify == "" {
|
||||||
verifycode = true
|
|
||||||
} else {
|
|
||||||
verifycode = false
|
verifycode = false
|
||||||
|
} else {
|
||||||
|
verifycode = true
|
||||||
}
|
}
|
||||||
|
|
||||||
conn := get_db_connection()
|
conn := get_db_connection()
|
||||||
|
@ -475,7 +474,7 @@ func main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(401, gin.H{"access_token": logincode, "token_type": "bearer", "expires_in": 2592000, "id_token": openid})
|
c.JSON(200, gin.H{"access_token": logincode, "token_type": "bearer", "expires_in": 2592000, "id_token": openid})
|
||||||
})
|
})
|
||||||
|
|
||||||
router.POST("/api/deleteauth", func(c *gin.Context) {
|
router.POST("/api/deleteauth", func(c *gin.Context) {
|
||||||
|
|
Reference in New Issue