Hello,
Just what I do ___
I use 5 min or 12 min epoxy but I also have used regular aliphatic glue.
The holding power of the magnets depends (vary) with the gap provided.
Experiments are done with non-magnetic temporary shims like cardboad to determine the holding power desired.
Two magnets can be used with proper polarity. We want attraction not repulsion

.
A single magnet can be used with a magnetic material for the other component. It can be a disk of tin can material (not aluminum LOL) or the head of a magnetic machine screw or bolt or magnetic wood screw.
The magnet should be held by the glue mechanically, not only by adhesion.
That is done by the shape of the cured glue. Any surplus glue can be filed or sanded away.
If this does not help anyone it does not hurt either.
Do what you like.
Zor