How to modify the logon starting of an app

I’m developing an app that make a user session throught a userid (passed to get parameter) but if the userid doesn’t exist i need to show a personal interface of my customer or redirect to his website.

How to better way to make this in Nextcloud SDK ?

You might have to write your own user back-end or listen to the (pre) login events in order to act on the login results.

I’m afraid the rest you have to explore yourself, I’m not aware of any app that does anything like that.