Skip to content
This repository was archived by the owner on Jun 7, 2020. It is now read-only.

Commit e119409

Browse files
authored
Merge pull request #2620 from RocketChat/bug/avatar_url_channel_authenticated
[FIX] Auth params into channel avatar URL
2 parents 74f5c46 + eed32d3 commit e119409

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Rocket.Chat/Models/Subscription/Subscription.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,14 @@ extension Subscription {
151151
guard
152152
let auth = auth ?? AuthManager.isAuthenticated(),
153153
let baseURL = auth.baseURL(),
154+
let userId = auth.userId,
155+
let token = auth.token,
154156
let encodedName = name.addingPercentEncoding(withAllowedCharacters: CharacterSet.urlQueryAllowed)
155157
else {
156158
return nil
157159
}
158160

159-
return URL(string: "\(baseURL)/avatar/%22\(encodedName)?format=jpeg")
161+
return URL(string: "\(baseURL)/avatar/%22\(encodedName)?format=jpeg&rc_uid=\(userId)&rc_token=\(token)")
160162
}
161163
}
162164

0 commit comments

Comments
 (0)