Fix two lint errors.

This commit is contained in:
Tommie Gannert 2022-06-08 09:40:11 +02:00
parent 4da104c5c3
commit dba1965c8b
2 changed files with 2 additions and 1 deletions

View file

@ -224,7 +224,7 @@ func SSOCallback(
if localpart == "" { if localpart == "" {
util.GetLogger(ctx).WithField("ssoIdentifier", result.Identifier).Info("no suggested user ID from SSO provider") util.GetLogger(ctx).WithField("ssoIdentifier", result.Identifier).Info("no suggested user ID from SSO provider")
var res uapi.QueryNumericLocalpartResponse var res uapi.QueryNumericLocalpartResponse
if err := userAPI.QueryNumericLocalpart(ctx, &res); err != nil { if err = userAPI.QueryNumericLocalpart(ctx, &res); err != nil {
util.GetLogger(ctx).WithError(err).WithField("ssoIdentifier", result.Identifier).Error("failed to generate numeric localpart") util.GetLogger(ctx).WithError(err).WithField("ssoIdentifier", result.Identifier).Error("failed to generate numeric localpart")
return jsonerror.InternalServerError() return jsonerror.InternalServerError()
} }

View file

@ -466,6 +466,7 @@ func Test_SSO(t *testing.T) {
t.Log("Retrieve localpart for association") t.Log("Retrieve localpart for association")
gotLocalpart, err := db.GetLocalpartForSSO(ctx, ns, issuer, subject) gotLocalpart, err := db.GetLocalpartForSSO(ctx, ns, issuer, subject)
assert.NoError(t, err, "unable to get localpart for SSO subject")
assert.Equal(t, aliceLocalpart, gotLocalpart) assert.Equal(t, aliceLocalpart, gotLocalpart)
t.Log("Remove SSO association") t.Log("Remove SSO association")