@@ -59,7 +59,7 @@ func TestCompleteSettings(t *testing.T) {
5959
6060 conf .MustSet (config .ViperKeySelfServiceSettingsPrivilegedAuthenticationAfter , "1m" )
6161
62- conf .MustSet (config .ViperKeyDefaultIdentitySchemaURL , "file://./stub/login .schema.json" )
62+ conf .MustSet (config .ViperKeyDefaultIdentitySchemaURL , "file://./stub/settings .schema.json" )
6363 conf .MustSet (config .ViperKeySecretsDefault , []string {"not-a-secure-session-key" })
6464
6565 t .Run ("case=device unlinking is available when identity has totp" , func (t * testing.T ) {
@@ -297,13 +297,14 @@ func TestCompleteSettings(t *testing.T) {
297297
298298 t .Run ("type=set up TOTP device" , func (t * testing.T ) {
299299 checkIdentity := func (t * testing.T , id * identity.Identity , key string ) {
300- _ , cred , err := reg .PrivilegedIdentityPool ().FindByCredentialsIdentifier (context .Background (), identity .CredentialsTypeTOTP , id .ID .String ())
300+ i , cred , err := reg .PrivilegedIdentityPool ().FindByCredentialsIdentifier (context .Background (), identity .CredentialsTypeTOTP , id .ID .String ())
301301 require .NoError (t , err )
302302 var c totp.CredentialsConfig
303303 require .NoError (t , json .Unmarshal (cred .Config , & c ))
304304 actual , err := otp .NewKeyFromURL (c .TOTPURL )
305305 require .NoError (t , err )
306306 assert .Equal (t , key , actual .Secret ())
307+ assert .Contains (t , c .TOTPURL , gjson .GetBytes (i .Traits , "subject" ).String ())
307308 }
308309
309310 run := func (t * testing.T , isAPI , isSPA bool , id * identity.Identity , hc * http.Client , f * kratos.SelfServiceSettingsFlow ) {
0 commit comments