unbind device push token on logout
This commit is contained in:
@@ -2618,6 +2618,24 @@ func (devicePushTokenMapper) Upsert(tenantID types.TenantID, token *types.Device
|
||||
return tenantAdp.TenantDevicePushTokenUpsert(tenantID, token)
|
||||
}
|
||||
|
||||
func (devicePushTokenMapper) Delete(tenantID types.TenantID, uid types.Uid, deviceID string) error {
|
||||
deviceID = strings.TrimSpace(deviceID)
|
||||
if uid.IsZero() || deviceID == "" {
|
||||
return types.ErrMalformed
|
||||
}
|
||||
tenantAdp, err := tenantBusinessAdapter(tenantID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
deleter, ok := tenantAdp.(interface {
|
||||
TenantDevicePushTokenDelete(types.TenantID, types.Uid, string) error
|
||||
})
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
return deleter.TenantDevicePushTokenDelete(tenantID, uid, deviceID)
|
||||
}
|
||||
|
||||
func (devicePushTokenMapper) GetAll(tenantID types.TenantID, uids ...types.Uid) (map[types.Uid][]types.DeviceDef, int, error) {
|
||||
tenantAdp, err := tenantBusinessAdapter(tenantID)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user