If the user is hosting the dashboard in the same domain as their blog (with a nginx suburi, for example), the two session cookies clash; logging into one service logs you out of the other. With this patch, both have separate names. Fixes https://gitlab.com/commento/commento-ce/issues/49
		
			
				
	
	
		
			23 lines
		
	
	
		
			465 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			465 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package main
 | |
| 
 | |
| import ()
 | |
| 
 | |
| func commenterSessionUpdate(commenterToken string, commenterHex string) error {
 | |
| 	if commenterToken == "" || commenterHex == "" {
 | |
| 		return errorMissingField
 | |
| 	}
 | |
| 
 | |
| 	statement := `
 | |
|     UPDATE commenterSessions
 | |
|     SET commenterHex = $2
 | |
|     WHERE commenterToken = $1;
 | |
|   `
 | |
| 	_, err := db.Exec(statement, commenterToken, commenterHex)
 | |
| 	if err != nil {
 | |
| 		logger.Errorf("error updating commenterHex: %v", err)
 | |
| 		return errorInternal
 | |
| 	}
 | |
| 
 | |
| 	return nil
 | |
| }
 |