I’d think it’d be more relevant to find out how FiveM’s forums achieve this as it’s very niche and it’d get removed; have tried previously and was deemed irrelevant. Was told to ask the website.
The redirect link for linking accounts has been implemented using specific functionality in the client, you’ll probably be unable to correctly emulate that for a custom server sign-in system.