Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
fix: errors when auth srv domain is not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
rot1024 committed Apr 6, 2022
1 parent 10691ac commit 6480734
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/adapter/http/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type SignupInput struct {
Secret *string `json:"secret"`
UserID *id.UserID `json:"userId"`
TeamID *id.TeamID `json:"teamId"`
Name *string `json:"name"`
Name *string `json:"username"`
Email *string `json:"email"`
Password *string `json:"password"`
Theme *user.Theme `json:"theme"`
Expand Down
8 changes: 6 additions & 2 deletions internal/app/auth_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ const (
func authEndPoints(ctx context.Context, e *echo.Echo, r *echo.Group, cfg *ServerConfig) {
userUsecase := interactor.NewUser(cfg.Repos, cfg.Gateways, cfg.Config.SignupSecret, cfg.Config.Host_Web)

domain, err := url.Parse(cfg.Config.AuthSrv.Domain)
d := cfg.Config.AuthSrv.Domain
if d == "" {
d = cfg.Config.Host
}
domain, err := url.Parse(d)
if err != nil {
panic("not valid auth domain")
log.Panicf("auth: not valid auth domain: %s", d)
}
domain.Path = "/"

Expand Down

0 comments on commit 6480734

Please sign in to comment.