Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since go 1.22 path variables are supported #547

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions gothic/gothic.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@
return p, nil
}

// since go-1.22 this is also supported
// see: https://go.dev/blog/routing-enhancements
if p := req.PathValue("provider"); p != "" {

Check failure on line 292 in gothic/gothic.go

View workflow job for this annotation

GitHub Actions / test (1.18.x, ubuntu-latest)

req.PathValue undefined (type *http.Request has no field or method PathValue)

Check failure on line 292 in gothic/gothic.go

View workflow job for this annotation

GitHub Actions / test (1.19.x, ubuntu-latest)

req.PathValue undefined (type *http.Request has no field or method PathValue)

Check failure on line 292 in gothic/gothic.go

View workflow job for this annotation

GitHub Actions / test (1.20.x, ubuntu-latest)

req.PathValue undefined (type *http.Request has no field or method PathValue)

Check failure on line 292 in gothic/gothic.go

View workflow job for this annotation

GitHub Actions / test (1.20.x, macos-latest)

req.PathValue undefined (type *http.Request has no field or method PathValue)

Check failure on line 292 in gothic/gothic.go

View workflow job for this annotation

GitHub Actions / test (1.21.x, ubuntu-latest)

req.PathValue undefined (type *http.Request has no field or method PathValue)
return p, nil
}

// As a fallback, loop over the used providers, if we already have a valid session for any provider (ie. user has already begun authentication with a provider), then return that provider name
providers := goth.GetProviders()
session, _ := Store.Get(req, SessionName)
Expand Down
Loading