April 2018
Beginner to intermediate
406 pages
9h 33m
English
We'll move on to implementing our actual login and authentication code in Phoenix! First, we'll need to set up our routes. Ueberauth is expecting us to provide a route for each provider and a callback for each provider as well. In lib/vocial_web/router.ex, we'll add a brand new scope for our Ueberauth routes called /auth. This means all OAuth-specific routes will be in the format of /auth/... . This also helps us segment away the code that deals specifically with Ueberauth's login details:
scope "/auth", VocialWeb do pipe_through :browser get "/:provider", SessionController, :request get "/:provider/callback", SessionController, :callback end
Next, we'll need to modify the aforementioned SessionController. ...
Read now
Unlock full access