mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	auth: Extract EXPIRABLE_SESSION_VAR_DEFAULT_EXPIRY_SECS.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							01498add9b
						
					
				
				
					commit
					dda4603f94
				
			@@ -103,6 +103,8 @@ if TYPE_CHECKING:
 | 
			
		||||
ParamT = ParamSpec("ParamT")
 | 
			
		||||
ExtraContext = Optional[Dict[str, Any]]
 | 
			
		||||
 | 
			
		||||
EXPIRABLE_SESSION_VAR_DEFAULT_EXPIRY_SECS = 3600
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def get_safe_redirect_to(url: str, redirect_host: str) -> str:
 | 
			
		||||
    is_url_safe = url_has_allowed_host_and_scheme(url=url, allowed_hosts=None)
 | 
			
		||||
@@ -184,11 +186,17 @@ def maybe_send_to_registration(
 | 
			
		||||
    assert not (mobile_flow_otp and desktop_flow_otp)
 | 
			
		||||
    if mobile_flow_otp:
 | 
			
		||||
        set_expirable_session_var(
 | 
			
		||||
            request.session, "registration_mobile_flow_otp", mobile_flow_otp, expiry_seconds=3600
 | 
			
		||||
            request.session,
 | 
			
		||||
            "registration_mobile_flow_otp",
 | 
			
		||||
            mobile_flow_otp,
 | 
			
		||||
            expiry_seconds=EXPIRABLE_SESSION_VAR_DEFAULT_EXPIRY_SECS,
 | 
			
		||||
        )
 | 
			
		||||
    elif desktop_flow_otp:
 | 
			
		||||
        set_expirable_session_var(
 | 
			
		||||
            request.session, "registration_desktop_flow_otp", desktop_flow_otp, expiry_seconds=3600
 | 
			
		||||
            request.session,
 | 
			
		||||
            "registration_desktop_flow_otp",
 | 
			
		||||
            desktop_flow_otp,
 | 
			
		||||
            expiry_seconds=EXPIRABLE_SESSION_VAR_DEFAULT_EXPIRY_SECS,
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
    try:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user