Commit a80c4055 authored by Prafful Suthar's avatar Prafful Suthar

feat(identity-provider): Fix for avatar upload

added fix where avatar upload failed

bug fix for avatar being null
parent 740542d2
......@@ -10,8 +10,6 @@ import {
@EventsHandler(FileUploadedCloudBucketEvent)
export class FileUploadedCloudBucketHandler
implements IEventHandler<FileUploadedCloudBucketEvent> {
constructor() {}
async handle(event: FileUploadedCloudBucketEvent) {
const spacesEndpoint: any = new AWS.Endpoint(
event.storageSettings.endpoint,
......
......@@ -34,7 +34,7 @@ export class NewAvatarUploadedHandler
let profile: Profile = await this.profileService.findOne({
uuid: event.clientHttpRequest.token.sub,
});
if (profile && profile.picture) {
if (profile) {
profile.picture = this.getProfileUrl(event);
await profile.save();
return profile;
......
export const APP_NAME = 'identity_provider';
export const CLIENT_ID = 'client_id';
export const REDIRECT_URI = 'redirect_uri';
export const SILENT_REFRESH_REDIRECT_URI = 'silent_refresh_redirect_uri';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment