mirror of
				https://github.com/Tivix/django-rest-auth.git
				synced 2025-11-04 01:27:36 +03:00 
			
		
		
		
	add REST_SESSION_LOGIN setting, v0.2.5
This commit is contained in:
		
							parent
							
								
									dc63dd4541
								
							
						
					
					
						commit
						4c611afd7f
					
				| 
						 | 
				
			
			@ -86,10 +86,8 @@ class Login(LoggedOutRESTAPIView, GenericAPIView):
 | 
			
		|||
 | 
			
		||||
            if user and user.is_authenticated():
 | 
			
		||||
                if user.is_active:
 | 
			
		||||
                    # TODO: be able to configure this to either be
 | 
			
		||||
                    # session or token or both
 | 
			
		||||
                    # right now it's both.
 | 
			
		||||
                    login(request, user)
 | 
			
		||||
                    if getattr(settings, 'REST_SESSION_LOGIN', True):
 | 
			
		||||
                        login(request, user)
 | 
			
		||||
 | 
			
		||||
                    # Return REST Token object with OK HTTP status
 | 
			
		||||
                    token, created = self.token_model.objects.get_or_create(user=user)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user