Skip to content

Commit 67ec50d

Browse files
committed
fine tune
1 parent 934f026 commit 67ec50d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

routers/web/auth/oauth.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ func SignInOAuth(ctx *context.Context) {
7272

7373
// SignInOAuthCallback handles the callback from the given provider
7474
func SignInOAuthCallback(ctx *context.Context) {
75-
provider := ctx.PathParam("provider")
76-
7775
if ctx.Req.FormValue("error") != "" {
7876
var errorKeyValues []string
7977
for k, vv := range ctx.Req.Form {
@@ -86,7 +84,8 @@ func SignInOAuthCallback(ctx *context.Context) {
8684
}
8785

8886
// first look if the provider is still active
89-
authSource, err := auth.GetActiveOAuth2SourceByAuthName(ctx, provider)
87+
authName := ctx.PathParam("provider")
88+
authSource, err := auth.GetActiveOAuth2SourceByAuthName(ctx, authName)
9089
if err != nil {
9190
ctx.ServerError("SignIn", err)
9291
return

services/auth/source/oauth2/providers_base.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ import (
1212

1313
// BaseProvider represents a common base for Provider
1414
type BaseProvider struct {
15-
name string
16-
displayName string
15+
name string
16+
displayName string
17+
18+
// TODO: maybe some providers also support SSH public keys, then they can set this to true
1719
supportSSHPublicKey bool
1820
}
1921

0 commit comments

Comments
 (0)