Commit graph

20 commits

Author SHA1 Message Date
rhymes
d6e47a03c7
[deploy] Authentication refactoring - step 1 (#7259)
* Add Authentication providers

* Making strides on refactoring

* New usr from Twitter

* Existing Twitter user

* Existing user Github

* Test skip_confirmation!

* Refactor a bit and add simplecov groups

* Test user already logged in

* Rename to Authentication::Authenticator

* Refactor to a common class

* Add existing user test for twitter login

* Refactor global handler

* Fix spec and comment Twitter provider

* Update comments and strategy TODO

* Move providers loading code to Authentication::Providers

* add SubclassResponsibility error

* Use delegation
2020-04-15 12:13:10 -04:00
rhymes
b8f2390cb5
Fix Datadog auth failure payload and add tests (#7150)
* Fix Datadog auth failure payload and add tests

* Use functional Ruby properly
2020-04-09 09:54:51 +07:00
rhymes
02b6ec5ad7
Send auth failures to Datadog (#7135) [deploy]
* Send auth failures to Honeybadger

* Fix error when it is nil

* Use Datadog instead of Honeybadger

* Fix metric name
2020-04-07 18:24:10 +02:00
Vaidehi Joshi
c7a1bd9449
Fix logging for dev and test environments (#5922)
* Fix logging for dev and test environments

We had some unused code for Timber in our config files for development and test.
However, this was completely clobbering Rails' default behavior of logging out to log/development.log and log/test.log. We should allow for logging in these environments in particular, and since we're not using Timber there, we can just revert to using the Rails default debugging log levels.

* Add Timber logger to specs that explicitly require it

* Restore default Rails.logger in specs using Timber logger

* Explicitly use Rails.logger in OmniauthCallbacksController

We seem to have different logger classes leaking into this controller in tests.
I'm not entirely sure why this is/haven't been able to investigate yet, but I do think we should be using the Rails.logger explicitly until we can figure that out.
2020-02-07 10:15:08 -05:00
Andy Zhao
b2e18aeb72 Use Redis for session storage (#4004) [deploy]
* WIP use redis-session-store for sessions

* Use Redis as session storage

* Add redis-server to Travis

* Use integer for SESSION_EXPIRY_SECONDS env variable

Co-Authored-By: rhymes <rhymesete@gmail.com>

* Remove sessions b/c no custom sessions logic

* Use ApplicationConfig instead

* Rename default value

* Remove rememberable module

* Persist the user for the test

* Remove remember_me related tests

* Revert 'undo remember_me' commits

* Add redis to procfile

* Cleanup devise configuration

* Move REDIS configuration in the basic configuration section

* Make sure the expiration time can't zero

* Restore old order and remove useless comment line

* Delete legacy session cookie after login

Once deployed the server will start using the new session cookie, this makes sure the legacy one is deleted on the user's browser

* Remove redis from Procfile

* Add signed, secure and httponly to the Redis session cookie
2019-11-12 10:10:34 -06:00
cyrillefr
4fd66372dc Enable Layout/AlignParameters (#2340)
Check if the parameters on a multi-line method call or definition are aligned.

Resolves: #2021
2019-04-08 18:47:34 -04:00
Abraham Williams
b98565a931 Update rubocop to 0.67 (#2313) [ci skip] 2019-04-05 12:55:13 -04:00
Andy Zhao
4e120b8a8e Add more logging to sign in failures (#2038)
* Actually redirect when rescuing an error

* Use inspect to view class as string

* Use a slightly more descriptive flash message
2019-03-12 16:33:10 -07:00
Andy Zhao
300291ed70 Use proper formats for env hash variables (#1624)
* Use proper formats for env hash variables

* Use .to_s instead of .name
2019-01-22 14:15:50 -05:00
Andy Zhao
2c2bafa350 Add logging if oauth fails (#1619) 2019-01-21 18:17:36 -05:00
Andy Zhao
e3f9792b21 Add logging info in case sign in fails (#1519)
* Add logging info in case sign in fails

* Use string interpolation instead

* Remove logger from auth service
2019-01-14 10:01:17 -05:00
M. Bellucci
a52af3da8b Avoid using meta-programming for solving code duplication. (#1457)
* Add feature spec for twitter login

* Avoid using class eval for solving code duplication.

This change make code easier to change in the future.

* Fix codeclimate issues

* Introduce explanatory methods
2019-01-11 12:00:09 -05:00
Andy Zhao
c3322be9ce Improve Sign In/Up Error Handling (#832)
* Add registration view to sign_in page

* Add better sad path for failed sign ins/ups

* Ensure email is downcased for authorization

* Remove .downcase for emails

* Use partial for styles
2018-10-11 13:31:37 -04:00
Ben Halpern
cf075d4a9f
Ben/fix authorization edge case (#748)
* Add top param to article tag api

* Fix user validation persistence bug
2018-09-25 18:46:17 -04:00
Mac Siri
40f488d991 Migrate to Travis CI (part 2) (#591)
* Update Travis.yml

* Update README

* Update README

* Adjust test to not rely on env vars

* Update encryption

* Refactor

* Update env key

* Stub AWS calls

* Create ApplicationConfig

* Fix specs

* Fix lint

* Update ApplicationConfig

* Remove travis env vars

* Fix lint

* Extend character limit to 100

* Add env to travis

* Take out auto-restart after deploy

* Immediately discarded test cache

* Stub GA in request specs

* Stub Pusher

* Fix broken specs

* Update fixture

* Add CodeClimate id

* Change CodeClimate key

* Remove merge mistakes

* WIP

* Add Envied gem & Change README

* Add missing keys

* Add missing key

* Update fixture

* Fix broken spec

* Add Slack Notification for Travis

* Fix wording

* Fix typo
2018-07-20 20:17:18 -04:00
Andy Zhao
9fa9a22d54 Add a comment for more public controllers (#553) 2018-07-09 18:14:34 -04:00
Ben Halpern
4d9019f8a1 Remove raise oooofffff 2018-06-12 23:19:46 -04:00
Ben Halpern
66cb24dddf Fix callback issue 2018-06-12 22:19:44 -04:00
Ben Halpern
cb4340819e Change Twitter callback_url 2018-06-12 21:40:55 -04:00
Mac Siri
301c6080e3 Initial commit 2018-02-28 16:11:08 -05:00