[backend/services] Check for profile URL and user URI when verifying links
This commit is contained in:
parent
fc07f55fe3
commit
aa3262caea
1 changed files with 5 additions and 3 deletions
|
@ -1201,9 +1201,11 @@ public class UserService(
|
||||||
var document = await new HtmlParser().ParseDocumentAsync(html);
|
var document = await new HtmlParser().ParseDocumentAsync(html);
|
||||||
|
|
||||||
userProfileField.IsVerified =
|
userProfileField.IsVerified =
|
||||||
document.Links.Any(a => a.GetAttribute("href") == profileUrl
|
document.Links.Any(a => (a.GetAttribute("rel")?.Contains("me")
|
||||||
&& (a.GetAttribute("rel")?.Contains("me")
|
?? false)
|
||||||
?? false));
|
&& a.GetAttribute("href") == profileUrl
|
||||||
|
|| user.Uri != null
|
||||||
|
&& a.GetAttribute("href") == user.Uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
bgDbContext.Update(bgUser.UserProfile);
|
bgDbContext.Update(bgUser.UserProfile);
|
||||||
|
|
Loading…
Add table
Reference in a new issue