mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	fix: #11906, userData.sso — don't serve deauthUrl or non-associated url if caller uid is not same as target uid
This commit is contained in:
		| @@ -104,7 +104,16 @@ helpers.getUserDataByUserSlug = async function (userslug, callerUID, query = {}) | |||||||
| 		canViewInfo: canViewInfo, | 		canViewInfo: canViewInfo, | ||||||
| 	}); | 	}); | ||||||
|  |  | ||||||
| 	userData.sso = results.sso.associations; | 	userData.sso = results.sso.associations.map((association) => { | ||||||
|  | 		if (!isSelf) { | ||||||
|  | 			delete association.deauthUrl; | ||||||
|  | 			if (!association.associated) { | ||||||
|  | 				delete association.url; | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		return association; | ||||||
|  | 	}); | ||||||
| 	userData.banned = Boolean(userData.banned); | 	userData.banned = Boolean(userData.banned); | ||||||
| 	userData.muted = parseInt(userData.mutedUntil, 10) > Date.now(); | 	userData.muted = parseInt(userData.mutedUntil, 10) > Date.now(); | ||||||
| 	userData.website = escape(userData.website); | 	userData.website = escape(userData.website); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user