Skip to content

Commit

Permalink
Fix url joining
Browse files Browse the repository at this point in the history
  • Loading branch information
ptman committed May 17, 2023
1 parent 026bb73 commit 61d3b1e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/web/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"gorm.io/gorm"
"io"
"net/http"
"net/url"
"strings"
)

Expand Down Expand Up @@ -261,18 +262,18 @@ func oauth(ctx echo.Context) error {
github.New(
config.C.GithubClientKey,
config.C.GithubSecret,
opengistUrl+"/oauth/github/callback"),
url.JoinPath(opengistUrl, "/oauth/github/callback")),

Check failure on line 265 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 1.19)

multiple-value url.JoinPath(opengistUrl, "/oauth/github/callback") (value of type (result string, err error)) in single-value context

Check failure on line 265 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 1.20)

multiple-value url.JoinPath(opengistUrl, "/oauth/github/callback") (value of type (result string, err error)) in single-value context

Check failure on line 265 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (macOS-latest, 1.19)

multiple-value url.JoinPath(opengistUrl, "/oauth/github/callback") (value of type (result string, err error)) in single-value context

Check failure on line 265 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (macOS-latest, 1.20)

multiple-value url.JoinPath(opengistUrl, "/oauth/github/callback") (value of type (result string, err error)) in single-value context
)

case "gitea":
goth.UseProviders(
gitea.NewCustomisedURL(
config.C.GiteaClientKey,
config.C.GiteaSecret,
opengistUrl+"/oauth/gitea/callback",
giteaUrl+"/login/oauth/authorize",
giteaUrl+"/login/oauth/access_token",
giteaUrl+"/api/v1/user"),
url.JoinPath(opengistUrl, "/oauth/gitea/callback"),

Check failure on line 273 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 1.19)

multiple-value url.JoinPath(opengistUrl, "/oauth/gitea/callback") (value of type (result string, err error)) in single-value context

Check failure on line 273 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 1.20)

multiple-value url.JoinPath(opengistUrl, "/oauth/gitea/callback") (value of type (result string, err error)) in single-value context

Check failure on line 273 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (macOS-latest, 1.19)

multiple-value url.JoinPath(opengistUrl, "/oauth/gitea/callback") (value of type (result string, err error)) in single-value context

Check failure on line 273 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (macOS-latest, 1.20)

multiple-value url.JoinPath(opengistUrl, "/oauth/gitea/callback") (value of type (result string, err error)) in single-value context
url.JoinPath(giteaUrl, "/login/oauth/authorize"),

Check failure on line 274 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 1.19)

multiple-value url.JoinPath(giteaUrl, "/login/oauth/authorize") (value of type (result string, err error)) in single-value context

Check failure on line 274 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 1.20)

multiple-value url.JoinPath(giteaUrl, "/login/oauth/authorize") (value of type (result string, err error)) in single-value context

Check failure on line 274 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (macOS-latest, 1.19)

multiple-value url.JoinPath(giteaUrl, "/login/oauth/authorize") (value of type (result string, err error)) in single-value context

Check failure on line 274 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (macOS-latest, 1.20)

multiple-value url.JoinPath(giteaUrl, "/login/oauth/authorize") (value of type (result string, err error)) in single-value context
url.JoinPath(giteaUrl, "/login/oauth/access_token"),

Check failure on line 275 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 1.19)

multiple-value url.JoinPath(giteaUrl, "/login/oauth/access_token") (value of type (result string, err error)) in single-value context

Check failure on line 275 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 1.20)

multiple-value url.JoinPath(giteaUrl, "/login/oauth/access_token") (value of type (result string, err error)) in single-value context

Check failure on line 275 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (macOS-latest, 1.19)

multiple-value url.JoinPath(giteaUrl, "/login/oauth/access_token") (value of type (result string, err error)) in single-value context

Check failure on line 275 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (macOS-latest, 1.20)

multiple-value url.JoinPath(giteaUrl, "/login/oauth/access_token") (value of type (result string, err error)) in single-value context
url.JoinPath(giteaUrl, "/api/v1/user")),

Check failure on line 276 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 1.19)

multiple-value url.JoinPath(giteaUrl, "/api/v1/user") (value of type (result string, err error)) in single-value context

Check failure on line 276 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 1.20)

multiple-value url.JoinPath(giteaUrl, "/api/v1/user") (value of type (result string, err error)) in single-value context

Check failure on line 276 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (macOS-latest, 1.19)

multiple-value url.JoinPath(giteaUrl, "/api/v1/user") (value of type (result string, err error)) in single-value context

Check failure on line 276 in internal/web/auth.go

View workflow job for this annotation

GitHub Actions / ci (macOS-latest, 1.20)

multiple-value url.JoinPath(giteaUrl, "/api/v1/user") (value of type (result string, err error)) in single-value context
)
}

Expand Down

0 comments on commit 61d3b1e

Please sign in to comment.