diff options
| author | mo khan <mo@mokhan.ca> | 2025-05-11 22:11:09 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-05-11 22:11:09 -0600 |
| commit | 7517e20bcce760c896e6b349c98cf04f88d6e00f (patch) | |
| tree | bc894004cb6ac3e14789c44a92f53987b44003b1 /app/controllers/sessions/controller.go | |
| parent | 086300ea0dbd0ff4af320a1b4402a93f5bd87ac0 (diff) | |
fix: redirect to dashboard when already logged in at callback url
Diffstat (limited to 'app/controllers/sessions/controller.go')
| -rw-r--r-- | app/controllers/sessions/controller.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/sessions/controller.go b/app/controllers/sessions/controller.go index 2853358..898244c 100644 --- a/app/controllers/sessions/controller.go +++ b/app/controllers/sessions/controller.go @@ -93,6 +93,11 @@ When it is decoded it has the following form: ``` */ func (c *Controller) Create(w http.ResponseWriter, r *http.Request) { + if middleware.IsLoggedIn(r) { + http.Redirect(w, r, "/dashboard", http.StatusFound) + return + } + tokens, err := c.svc.Exchange(r) if err != nil { pls.LogError(r.Context(), err) |
