What is the correct way to fix a leaky drain trap that is not detachable?
Wow, someone butchered that install. You really should think about replacing the trap and the shower drain. You mentioned that both were leaking but the pipe into the drain has been fixed and now only the trap leaks. They will leak again. I've never seen a drain connected like that. The drain looks like it was modified to take the pipe, poorly.
If you can pinpoint the leak, clean and rough up the surface.Widen the leak area a bit to make room for the epoxy. Then try some marine epoxy and coat the area. Follow the directions for curing time. this might buy you a little time.