From 2162f216360129f147da1fd5f3d8fae5233c0d1d Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Thu, 26 Aug 2021 19:56:40 +0200 Subject: fix broken db queries in auth (#160) --- internal/api/client/auth/callback.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'internal/api/client/auth/callback.go') diff --git a/internal/api/client/auth/callback.go b/internal/api/client/auth/callback.go index cbb429352..c2fbfb486 100644 --- a/internal/api/client/auth/callback.go +++ b/internal/api/client/auth/callback.go @@ -78,10 +78,8 @@ func (m *Module) CallbackGETHandler(c *gin.Context) { c.JSON(http.StatusInternalServerError, gin.H{"error": "no client_id found in session during callback"}) return } - app := >smodel.Application{ - ClientID: clientID, - } - if err := m.db.GetWhere(c.Request.Context(), []db.Where{{Key: sessionClientID, Value: app.ClientID}}, app); err != nil { + app := >smodel.Application{} + if err := m.db.GetWhere(c.Request.Context(), []db.Where{{Key: sessionClientID, Value: clientID}}, app); err != nil { m.clearSession(s) c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("no application found for client id %s", clientID)}) return -- cgit v1.2.3