Accidentally put redirect uri check before scanning it in
This commit is contained in:
parent
52dcc8c282
commit
fb0a298ae3
21
main.go
21
main.go
|
@ -807,16 +807,6 @@ func main() {
|
||||||
|
|
||||||
var appidcheck, rdiruricheck string
|
var appidcheck, rdiruricheck string
|
||||||
|
|
||||||
if !(rdiruricheck == redirect_uri) {
|
|
||||||
c.String(401, "Redirect URI does not match")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if deny == "true" {
|
|
||||||
c.Redirect(302, redirect_uri+"?error=access_denied&state="+state)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
err := conn.QueryRow("SELECT appId, rdiruri FROM oauth WHERE appId = ? LIMIT 1", appId).Scan(&appidcheck, &rdiruricheck)
|
err := conn.QueryRow("SELECT appId, rdiruri FROM oauth WHERE appId = ? LIMIT 1", appId).Scan(&appidcheck, &rdiruricheck)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, sql.ErrNoRows) {
|
if errors.Is(err, sql.ErrNoRows) {
|
||||||
|
@ -828,6 +818,17 @@ func main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !(rdiruricheck == redirect_uri) {
|
||||||
|
c.String(401, "Redirect URI does not match")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if deny == "true" {
|
||||||
|
c.Redirect(302, redirect_uri+"?error=access_denied&state="+state)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if !(appidcheck == appId) {
|
if !(appidcheck == appId) {
|
||||||
fmt.Println(appidcheck, appId)
|
fmt.Println(appidcheck, appId)
|
||||||
c.String(401, "OAuth screening failed")
|
c.String(401, "OAuth screening failed")
|
||||||
|
|
Reference in New Issue