Do I even need Router, Controllers and Views if I don't plan on developing HTML through Phoenix?

phx.gen.auth concerns itself with the authentication part of your app, you can pair it with something like Guardian to handle the authorization for the APIs.

But since @peppy already handles the auth in the PHP app, yeah, phx.gen.auth is unnecessary.

Don’t know how your app is structured, but you can have problems requesting cookies if they are in different domains (or even different subdomains if the cookie is a secure one IIRC).

Without knowing more about your app it is hard to know the best solution, my first naive approach would be that as soon as you log in your php app calls an endpoint in the phoenix app that will generate a Bearer Token that the php app will send to the client, the client will send this token when establishing the connection with the phoenix app, if the Token is valid you create the websocket, if not, just ignore.

2 Likes