Skip to content

Commit

Permalink
added host to init sso flow
Browse files Browse the repository at this point in the history
  • Loading branch information
mekilis committed Jan 21, 2025
1 parent 94a7ea6 commit c91c1bf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/handlers/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func (h *Handler) InitSSO(w http.ResponseWriter, r *http.Request) {
JWT: jwt.NewJwt(&configuration.Auth.Jwt, h.A.Cache),
ConfigRepo: postgres.NewConfigRepo(h.A.DB),
LicenseKey: configuration.LicenseKey,
Host: configuration.Host,
Licenser: h.A.Licenser,
}

Expand Down
1 change: 1 addition & 0 deletions api/models/sso.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package models

type SSORequest struct {
LicenseKey string `json:"license_key"`
Host string `json:"host"`
}

type SSOResponse struct {
Expand Down
2 changes: 2 additions & 0 deletions services/login_sso.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type LoginUserSSOService struct {
Licenser license.Licenser

LicenseKey string
Host string
}

const ssoUrl = "https://ssoproxy.getconvoy.io"
Expand All @@ -38,6 +39,7 @@ func (u *LoginUserSSOService) Run() (*models.SSOLoginResponse, error) {

ssoReq := models.SSORequest{
LicenseKey: u.LicenseKey,
Host: u.Host,
}

if ssoReq.LicenseKey == "" {
Expand Down

0 comments on commit c91c1bf

Please sign in to comment.