Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote user picture blob url #73

Closed
ohgasauraus opened this issue Nov 15, 2017 · 3 comments
Closed

Remote user picture blob url #73

ohgasauraus opened this issue Nov 15, 2017 · 3 comments

Comments

@ohgasauraus
Copy link

ohgasauraus commented Nov 15, 2017

Hi, our user pictures are stored remotely and i can't seem to use it with the <nb-user> component.

I am getting this warning message as follow and the picture is not shown:
WARNING: sanitizing unsafe style value url(SafeValue must use [property]=binding: blob:http://localhost:4200/30dcca0e-0630-4769-accf-4c6d72aaf61d (see http://g.co/ng/security#xss)) (see http://g.co/ng/security#xss)

My file download code as follows:
this.file.fileDownload(user.id).subscribe(res => {
  var blob = res.blob();
  var url = window.URL.createObjectURL(blob);
  this.img = this.sanitizer.bypassSecurityTrustUrl(url);
})

<nb-user [name]="name" [picture]="img"></nb-user>

Isn't <nb-user> picture property already using property binding as stated in the warning message?
Is this a bug with the <nb-user> component?

@nnixaa
Copy link
Collaborator

nnixaa commented Nov 16, 2017

Hi @ohgasauraus, as per documentation it is only possible to specify an absolute path or URL to your image.

@ohgasauraus
Copy link
Author

Oh, didn't notice that.
Before this, I was using from using ng2-admin and I was able to use this method to load the user picture.
Will this be considered as future feature enhancement?

@nnixaa
Copy link
Collaborator

nnixaa commented Feb 19, 2018

Fixed in #238

@nnixaa nnixaa closed this as completed Feb 19, 2018
@nnixaa nnixaa added this to the rc.6 milestone Feb 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants