drop primary key constraint from userapi_devices.access_token

This commit is contained in:
Roman Isaev 2024-12-31 01:40:14 +00:00
parent ff63e7fa98
commit bf310d558f
No known key found for this signature in database
GPG key ID: 7BE2B6A6C89AEC7F
5 changed files with 111 additions and 12 deletions

View file

@ -283,8 +283,6 @@ func (m *MSC3861UserVerifier) getUserByAccessToken(ctx context.Context, token st
Msg: strings.Join([]string{"Invalid device ID in scope: ", deviceID}, ""),
}
}
logger.Debugf("deviceID is: %s", deviceID)
logger.Debugf("scope is: %+v", scopes)
userDeviceExists := false
{
@ -302,14 +300,13 @@ func (m *MSC3861UserVerifier) getUserByAccessToken(ctx context.Context, token st
}
}
}
logger.Debugf("userDeviceExists is: %t", userDeviceExists)
if !userDeviceExists {
var rs api.PerformDeviceCreationResponse
deviceDisplayName := "OIDC-native client"
if err := m.userAPI.PerformDeviceCreation(ctx, &api.PerformDeviceCreationRequest{
Localpart: localpart,
ServerName: m.serverName,
AccessToken: token,
AccessToken: "",
DeviceID: &deviceID,
DeviceDisplayName: &deviceDisplayName,
// TODO: Cannot add IPAddr and Useragent values here. Should we care about it here?