Fix handling of twitch auth flow rejection
This commit is contained in:
		
							parent
							
								
									12d4ffad2b
								
							
						
					
					
						commit
						19f51d3a5a
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -110,7 +110,10 @@ app.post("/api/deleteRequest", async (request, response) => { | ||||||
| 
 | 
 | ||||||
| // Twitch callback
 | // Twitch callback
 | ||||||
| app.get("/callback", async (request, response) => { | app.get("/callback", async (request, response) => { | ||||||
| 	if (request.query.error) response.redirect(307, '/'); | 	if (request.query.error) { | ||||||
|  | 		response.redirect(307, '/'); | ||||||
|  | 		return; | ||||||
|  | 	} | ||||||
| 	var authcode = request.query.code as string; | 	var authcode = request.query.code as string; | ||||||
| 	var tokenResponse = await fetch("https://id.twitch.tv/oauth2/token", { method: "POST", body: new URLSearchParams({ | 	var tokenResponse = await fetch("https://id.twitch.tv/oauth2/token", { method: "POST", body: new URLSearchParams({ | ||||||
| 		client_id: config.twitchClientId, | 		client_id: config.twitchClientId, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue