mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	feat: new hook filter:user.logout
- used for setting "next" for post logout redirection
This commit is contained in:
		| @@ -194,6 +194,11 @@ app.cacheBuster = null; | |||||||
|  |  | ||||||
| 					$(window).trigger('action:app.loggedOut', data); | 					$(window).trigger('action:app.loggedOut', data); | ||||||
| 					if (data.next) { | 					if (data.next) { | ||||||
|  | 						if (data.next.startsWith('http')) { | ||||||
|  | 							window.location.href = data.next; | ||||||
|  | 							return; | ||||||
|  | 						} | ||||||
|  |  | ||||||
| 						ajaxify.go(data.next); | 						ajaxify.go(data.next); | ||||||
| 					} else { | 					} else { | ||||||
| 						ajaxify.refresh(); | 						ajaxify.refresh(); | ||||||
|   | |||||||
| @@ -498,10 +498,12 @@ authenticationController.logout = function (req, res, next) { | |||||||
| 						return res.status(500); | 						return res.status(500); | ||||||
| 					} | 					} | ||||||
|  |  | ||||||
| 					res.status(200).send({ | 					payload = { | ||||||
| 						header: payload.header, | 						header: payload.header, | ||||||
| 						config: res.locals.config, | 						config: res.locals.config, | ||||||
| 					}); | 					}; | ||||||
|  | 					plugins.fireHook('filter:user.logout', payload); | ||||||
|  | 					res.status(200).send(payload); | ||||||
| 				}); | 				}); | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user