fix: redirect after login
	
		
			
	
		
	
	
		
			
				
	
				Gitea/subman-nextjs/pipeline/head This commit looks good
				
					Details
				
			
		
	
				
					
				
			
				
	
				Gitea/subman-nextjs/pipeline/head This commit looks good
				
					Details
				
			
		
	This commit is contained in:
		
							parent
							
								
									da361e0f55
								
							
						
					
					
						commit
						2c7d72d8ba
					
				| 
						 | 
					@ -35,7 +35,8 @@ export default function LoginForm() {
 | 
				
			||||||
		if (res.status === 200) {
 | 
							if (res.status === 200) {
 | 
				
			||||||
			toast({ title: "login successful!" })
 | 
								toast({ title: "login successful!" })
 | 
				
			||||||
			setSubmitted(true)
 | 
								setSubmitted(true)
 | 
				
			||||||
			await revalidate(redirect)
 | 
								// await revalidate(redirect)
 | 
				
			||||||
 | 
								window.location.href = redirect
 | 
				
			||||||
			//BUG:the first time user logs in, page refreshes instead of redirecting
 | 
								//BUG:the first time user logs in, page refreshes instead of redirecting
 | 
				
			||||||
			router.push(redirect)
 | 
								router.push(redirect)
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue