Commit 59a68b9b authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Better input validation for Steam link operations.

parent 750fa97a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
## [Unreleased]
### Fixed
- Fix the registered function name for 'nk.channelIdBuild' in the JavaScript runtime.
- Better input validation for Steam link operations.

## [3.10.0] - 2021-12-16
### Added
+4 −0
Original line number Diff line number Diff line
@@ -413,6 +413,10 @@ func (s *ApiServer) LinkSteam(ctx context.Context, in *api.LinkSteamRequest) (*e
		}
	}

	if in == nil || in.Account == nil || in.Account.Token == "" {
		return nil, status.Error(codes.InvalidArgument, "Steam access token is required.")
	}

	err := LinkSteam(ctx, s.logger, s.db, s.config, s.socialClient, s.router, userID, username, in.Account.Token, in.Sync == nil || in.Sync.Value)
	if err != nil {
		return nil, err