benonymus
Hey there,
I added social media logins (fb, g) and here is the flow
user click on login with fb button on client and calls /auth/facebook
gets redirected to facebook logs in
response from facebook comes to the backend to /auth/facebook/callback
i create a user and log him in
and send the user back in the json response as with the normal login
but the problem is that with the response the client is not on the original page, but on a link to the backend
how can this be done in a way that the user stays on the client page?
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
wolfiton
Hey,
Please calrify this:
So you are using phoenix in api mode?
What client are you using react vue angular ember?
Or are you using phoenix with views ?
benonymus
The client is vue but would also be an ios and android
I am using phoenix with json views
wolfiton
I think you will have to redirect the user your desired page after the login.
Also are you using absinthe?
benonymus
no i don’t
but the problem is the redirect, I am sending a json response, with the logged in user
but it shows up in the browser as a page of json from a link that points to the server from facebook or google and looks like this:
http://localhost:4000/auth/google/callback?code=4/idsaasGUxia0zA-zJpyJuR3Rl4FI9p6QV7cIH155gEJ4SXFbQmCpGi0dTcwYOuhzBfR0R80zlGB78KQSH9pV3nwc&scope=email+profile+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile&authuser=0&session_state=94ec4fa79800647bedfe1ab561ef53f771ef6831..3638&prompt=none
wolfiton
Can you share some code on where you think is the problem, maybe where you create a the login and also the mix.exs file to see what packages you are using?
benonymus
maybe i was not clear, the problem is to how to get back to the client page at the end instead of landing on the page of the server.
I don’t know how to tackle the issue
it is working as expected all, just that is it possible and if yes how to end up back on the client page
deps:
wolfiton
Let;s try this
Instead of render replace with redirect(to: “/”)
This should redirect on succesfull auth to the / home page.
benonymus
well that is something, but we are not really ahead with that because we are still in the realm of the server, this would take us to the homepage of the server, not the client, and no user anymore obviously
wolfiton
Can vue read the json from your backend in a component?
Do you see them connected?
Also i assume that your vue is on :8080 and your server on 4000 ports?
benonymus
they are on separate hosts, not connected
for this: Can vue read the json from your backend in a component?
i am not sure, i am not working on the vue project, but I am sending the exact same response in the usual login flow and there are no problem there at all, the issue here seems to be that because the facebook login opens in the same window as the app it doesnt get back to the app/client