These are chat archives for padrino/padrino-framework

19th
Jun 2017
Sushant Bajracharya
@sushant12
Jun 19 2017 06:31
has anyone done a fb login with omniauth facebook in padrino?
padrinobot
@padrinobot
Jun 19 2017 06:45
wikimatze hi sushant12
Sushant Bajracharya
@sushant12
Jun 19 2017 06:45
hi @wikimatze
padrinobot
@padrinobot
Jun 19 2017 06:48
wikimatze I have not tried it so far ... maybe this can help you
wikimatze if not, we need to update the guide
wikimatze and the app https://github.com/mkdynamic/omniauth-facebook is for Rails but it should help you further
Sushant Bajracharya
@sushant12
Jun 19 2017 07:03
well i have not read that guide but i have got it working
thanks for the links @wikimatze , i appreciate it
padrinobot
@padrinobot
Jun 19 2017 07:06
wikimatze great, did you get it working nearly the same way as described in the guides?
wikimatze Did you found an easier way?
wikimatze Think your app is: https://github.com/sushant12/fuitter
Sushant Bajracharya
@sushant12
Jun 19 2017 07:07
yes you are right
it is similar to the guides
but i have some confusions
after login in(auth/facebook) i am redirected to auth/facebook/callback ....... and padrino shows
Try this:
# in app.rb
class Fuitter::App
  get '/auth/facebook/callback' do
    "Hello World"
  end
end
i have the same route in a session controller inside the controller folder
do i have to place the route code inside app.rb?
reading the docs app/app.rb – This is the primary configuration file for your core application.
padrinobot
@padrinobot
Jun 19 2017 07:11
wikimatze you can put it there ... but it would be better to create a custom controller with only that route
Sushant Bajracharya
@sushant12
Jun 19 2017 07:12
i did create a session controller insdie the controller folder and place the route there but it did not find the route there and showed me the err ^^
padrinobot
@padrinobot
Jun 19 2017 07:12
wikimatze hmmm
wikimatze so a route in the way:
wikimatze get :auth, :map => '/auth/:provider/callback' do
wikimatze does not work
Sushant Bajracharya
@sushant12
Jun 19 2017 07:17
well it works if i put it in the app.rb file
but i want to put it inside session controller
or do u recommend putting it inside app.rb?
the guide is using controller.rb file to put its route
padrinobot
@padrinobot
Jun 19 2017 07:19
wikimatze session controller would be the right way to do it
wikimatze To get it working and go on, just go on with the app/app.rb solution
wikimatze maybe you can create a branch for it.
Sushant Bajracharya
@sushant12
Jun 19 2017 07:20
branch for it?
why is it that padrino`s not searching inside the controllers for the routes?
padrinobot
@padrinobot
Jun 19 2017 07:23
wikimatze normally it doues
wikimatze can you print rake routes
wikimatze there should be your session controller route be listed
Sushant Bajracharya
@sushant12
Jun 19 2017 07:27

u are right, my route looked somethign like this

  get  '/auth/:provider/callback' do
    ap request.env["omniauth.auth"]
    redirect '/'
  end

and it was not showing up in the rake routes

thanks it works now
padrinobot
@padrinobot
Jun 19 2017 07:28
wikimatze what did you wrong?
wikimatze I think you missed a named route, like get :auth ...
Sushant Bajracharya
@sushant12
Jun 19 2017 07:29
i forgot to send a paramter to get like get :auth, '/aiuth' ....
padrinobot
@padrinobot
Jun 19 2017 07:29
wikimatze or?
Sushant Bajracharya
@sushant12
Jun 19 2017 07:29
ya u r rught
right*
that made the difference
padrinobot
@padrinobot
Jun 19 2017 07:29
wikimatze awesome, would you mind to review the guide from http://padrinorb.com/blog/padrino-and-omniauth-overview/
Sushant Bajracharya
@sushant12
Jun 19 2017 07:30
sure thing
padrinobot
@padrinobot
Jun 19 2017 07:30
wikimatze what's relevant there, what need to be changed?
wikimatze since it's only (sadly) a blog entry, we should consider putting this into the guides for everyone
Sushant Bajracharya
@sushant12
Jun 19 2017 07:31
ya that would be great.
Sushant Bajracharya
@sushant12
Jun 19 2017 07:31
gotcha
m on it
padrinobot
@padrinobot
Jun 19 2017 07:34
wikimatze great great great
padrinobot
@padrinobot
Jun 19 2017 07:46
wikimatze if you need help, let us know
Sushant Bajracharya
@sushant12
Jun 19 2017 07:46
just got an err and tryna debug
Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written fo
nevermind
Sushant Bajracharya
@sushant12
Jun 19 2017 07:59
@wikimatze while setting up the demo foo app, i ran into few issues like the migration issue and there is a comment saying # at the top before the class definition but it actually should be before
everything else is working fine
should these be updated in the blog post?
Sushant Bajracharya
@sushant12
Jun 19 2017 08:20
found some issues while fetching name and email from auth hash
padrinobot
@padrinobot
Jun 19 2017 14:04
wikimatze yeah, please update that in your PR
wikimatze thanks for the great contributions
padrinobot
@padrinobot
Jun 19 2017 19:04
wikimatze Hi
wikimatze Afzer sushant12 was so nice to update the docu for oauth and facebook (padrino/padrino-docs#145), I've moved this guide from the blog to the official guide under the "Advanced