File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ gem "thruster", require: false
4545# gem "image_processing", "~> 1.2"
4646
4747# auth gems
48- gem ' omniauth'
49- gem ' omniauth-google-oauth2'
48+ gem " omniauth"
49+ gem " omniauth-google-oauth2"
5050
5151group :development , :production do
5252 gem "sidekiq"
Original file line number Diff line number Diff line change 11class SessionsController < ApplicationController
22 def create
3- auth = request . env [ ' omniauth.auth' ]
3+ auth = request . env [ " omniauth.auth" ]
44 session [ :user_token ] = auth . credentials . token
55 session [ :user_email ] = auth . info . email
66 redirect_to root_path
Original file line number Diff line number Diff line change 11Rails . application . config . middleware . use OmniAuth ::Builder do
2- provider :google_oauth2 , ENV [ ' GOOGLE_CLIENT_ID' ] , ENV [ ' GOOGLE_CLIENT_SECRET' ]
2+ provider :google_oauth2 , ENV [ " GOOGLE_CLIENT_ID" ] , ENV [ " GOOGLE_CLIENT_SECRET" ]
33end
44OmniAuth . config . allowed_request_methods = %i[ get ]
Original file line number Diff line number Diff line change 11Rails . application . routes . draw do
2- resources :puzzles , only : [ :index ] do
3- resource :state , only : [ :update ] , module : :puzzles
2+ resources :puzzles , only : [ :index ] do
3+ resource :state , only : [ :update ] , module : :puzzles
44 end
5- resources :sessions , only : [ :create , :destroy ]
5+ resources :sessions , only : [ :create , :destroy ]
66
77 # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
88
99 # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
1010 # Can be used by load balancers and uptime monitors to verify that the app is live.
1111 get "up" => "rails/health#show" , as : :rails_health_check
1212
13- get ' /auth/:provider/callback' , to : ' sessions#create'
13+ get " /auth/:provider/callback" , to : " sessions#create"
1414
1515 # Render dynamic PWA files from app/views/pwa/* (remember to link manifest in application.html.erb)
1616 # get "manifest" => "rails/pwa#manifest", as: :pwa_manifest
You can’t perform that action at this time.
0 commit comments