mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-17 09:13:28 +03:00
fix: OIDC client image can't be deleted
This commit is contained in:
@@ -744,6 +744,7 @@ func (s *OidcService) DeleteClientLogo(ctx context.Context, clientID string) err
|
|||||||
return errors.New("image not found")
|
return errors.New("image not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
oldImageType := *client.ImageType
|
||||||
client.ImageType = nil
|
client.ImageType = nil
|
||||||
err = tx.
|
err = tx.
|
||||||
WithContext(ctx).
|
WithContext(ctx).
|
||||||
@@ -753,7 +754,7 @@ func (s *OidcService) DeleteClientLogo(ctx context.Context, clientID string) err
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
imagePath := common.EnvConfig.UploadPath + "/oidc-client-images/" + client.ID + "." + *client.ImageType
|
imagePath := common.EnvConfig.UploadPath + "/oidc-client-images/" + client.ID + "." + oldImageType
|
||||||
if err := os.Remove(imagePath); err != nil {
|
if err := os.Remove(imagePath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user