Peel the garlic and ginger. Coarsely chop the garlic and grate the ginger.
Coarsely crush the coriander, cumin and mustard seeds in the mortar. Add the garlic and ginger and grind to a smooth paste. Mix with the turmeric and garam masala.
Remove the skin from the chicken thighs, if desired.
Brush the chicken with the spice paste, cover with cling film and marinate for 2 hours in the fridge.
Meanwhile, peel and slice the pineapple. Remove the hard stalk.
Juice the lime. Wash, halve and deseed the chilli. Cut into thin strips and mix with 3 tbsp oil, 3 tbsp lime juice and some salt and sugar.
Wash the coriander, shake dry and pick off half the leaves. Chop the leaves roughly, mix with the chilli sauce and pour over the pineapple. Cover with cling film and allow to stand at room temperature until ready to serve.
Peel and slice the onions.
Heat the remaining oil in a pan and fry the onion slices for 1 minute. Transfer to a plate.
Remove the chicken pieces from the marinade, sprinkle with salt and fry in the pan over a high heat until golden on all sides. Return the onions to the pan and cook for 35 minutes in the preheated oven at 200°C (180°C fan, gas 6). Turn the chicken halfway through cooking. Serve the chicken and onion with the pinapple salad and garnish with the remaining coriander.