Commit graph

9 commits

Author SHA1 Message Date
Kirk Haines
ed74f2f245
Abstract DatadogStatsClient to ForemStatsClient (#12304)
* This change abstracts the DatadogStatsClient into a ForemStatsClient.
The purpose of this abstraction is to set the foundation for a subsequent PR that will allow one to use New Relic for recording Forem stats, instead of Datadog, if there is a New Relic configuration found.
This specific change creates an abstraction layer that can be built upon, without changing any actual default behavior. All specs still pass.

* Use delegate instead of explicit methods.

* Delegate instead of explicit methods.

* Fix the error.

* Refactor according to the suggestions in the comments.

* Ooops.  Stats work better when all of the code is committed.

* Removing the alias of count to increment since that was done in error.
2021-01-27 11:25:44 -05:00
Fernando Valverde
fcc5c0d2a1
Add Sign in with Apple (#11934)
* Add gem omniauth-apple

* Integrate omniauth-apple

* Integrate callback

* Add fields

* Add tests, fix bugs and make it all work

* Show only enabled providers for the current user

* Add default profile image for Apple

* Remove localhost patch

* Bring over the changed Apple username if the user changes it

* More specs fixed

* Incorporate feedback from PR

* Fix specs

* Simplify code and fix spec

* Fix Broadcast generators to take into account the new provider

* Fix spec

* Generate a truly unique apple_username

* Fix user specs

* Add omniauth-apple-0.0.2 to vendor cache

* Fix merge conflict and spec

* Update VCR fastly sloan cassette

* Revert "Generate a truly unique apple_username"

This reverts commit 2462875575b0bbd6b3c1d56b25afcd3189671608.

* Fix user specs

* Fix specs

* Fix specs

* Hide Connect Apple button behind a feature flag

* Revert "Hide Connect Apple button behind a feature flag"

This reverts commit 105bde0373389a4eb9b6e948f60734c7e0e99cba.

* Fix line lengths

* Fix spec

* ES tag

* CSRF bypass for Apple callback

* custom user_nickname in Apple provider with small tweaks + omniauth-apple bump

* Fixes username specs

* Makes Apple users default image Users::ProfileImageGenerator

* Fallback to mascot_image_url in test environment to avoid breaking Travis

* Fixes Apple CSRF error + makes default nickname more readable

* Trigger Travis

* Better devise config

* Apple SiteConfig entires in /admin/config

* Fixing specs

* Adds beta_access? to Authentication::Providers::Provider

* Fixes specs

* Codeclimate double quote fix in Gemfile

* Fixes /admin/config allowed params & adds feature flag for provider beta_access?

* Remove Enfile & adds temporary docs

* Adds custom apple auth provider settings

* Fix authenticator spec

* Fix configs spec (use last instead of first to avoid apple special case)

* Remove dangling fields from /admin/config

* updates feature flag

* More test fixes

* Hide config behind feature flag too

* omniauth-apple bump

* Takes care of edge case fallback

* Reverse apple_username update

* Adds auth_time to info hash in apple omniauth mock

* Switch to next instead of nesting for feature flag

* Fixes CVE-2015-9284

* Fixes specs after auth providers initiatior refactor from GET to POST

* Spec fixes

* More spec fixes

* Fix Rails codebase reference link

Co-authored-by: rhymes <rhymesete@gmail.com>
Co-authored-by: rhymes <rhymes@hey.com>
2020-12-18 10:22:33 -06:00
ludwiczakpawel
73e560f7a2
Updating navigation (especially mobile) (#10424)
* .

* .

* .

* .

* .

* specs

* specs

* .

* .

* merge

* moving cheese around

* layout

* .

* merge

* Fixed invalid selector for search.

* Fixed issue with URL not updating after a search.

* do things better

* kinda merge

* whoops

* whoops

* .

* .

* im a backend developer

* tooltips 1.0.1

* tooltips 1.0.1

* fix

* specs

* .

* reduce the spacing

* schema drop

* reverts

* revert

* reverts

* revert

* drop unused nav

* drop unused nav

* drop unused nav

* drop unused nav

* typos

* paths fixes

* speeding up JS

* js

* search

* Reworked initializeTopBarIcons.js

* Reworked initializeNavigation.js

* Small refactor and updated exported function API docs.

* Fixed a bug I created when refactoring the top navigation icons.

* sidebar nav links

* spec

* Fixed issues with logged out experience for top nav icons.

* Small refactor of top nav icons.

* Small refactor and added some API docs.

* Added @testing-library/dom

* Added tests for top navigation utilities.

* spec

* spec

Co-authored-by: Nick Taylor <nick@dev.to>
2020-12-08 15:59:21 +01:00
Arit Amana
42e10e7b42
[EOY2020 Issue] Default new forems to Email Authentication only (#11696)
* Set default Auth Providers to empty array

* complete implementation; tests remain

* tests

* fix failing specs authenticator_spec.rb

* Fix failing specs

* fix more failing specs

* fix more failing specs 2

* update failing spec

* Update app/views/admin/configs/_auth_provider_settings.html.erb

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>

* Update app/assets/stylesheets/admin.scss

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-12-02 16:49:07 -05:00
Jacob Herrington
221f134d83
Remove code setting SiteConfig values in specs (#10811) 2020-10-12 12:06:10 -05:00
Jacob Herrington
c37b283865
Allow Forem admins to enable an invite only mode. (#10758)
* Add invite only mode field to SiteConfig

* Add UI elements for invite only mode
2020-10-12 11:27:22 -04:00
Fernando Valverde
779fad25b9
[deploy] Sets Omniauth full_host config to match the environment (#10419)
* Sets Omniauth full_host config to match the environment

* Fixes tests by passing missing params in omniauth env to mocks

* Default param as nil in omniauth mock helpers
2020-09-22 15:47:50 -06:00
Lisa Sy
54c071856e
[deploy] Update top-header for logged-out user (#9874)
* Create first start at desktop top header updates

* Update mobile styling of top header

* Stylize sign in widget card

* Update nav menu and top bar

* Changes based on user being logged-in or not

* Uses user_signed_in? on top nav bar

* Fix lingering old cloudinary helper method

* Trigger CI

* Fixes specs

* Adds redirect_using_referer_spec, fixes other specs & cleanup

* Adds nav-menu.scss to layouts/_styles.html.erb for inline & small edit in referer check

* Remove logged-out styles to make it more uniform with logged in

* Remove nav-menu.scss file

* cleanup markup and JS a little

* Fixes FB auth specs to new login links

* Makes sure unauthenticated /new redirects back to editor

* CI fix Sing in with -> Continue with

* Update db/schema.rb

* Update db/schema.rb

* Update db/schema.rb

Co-authored-by: Fernando Valverde <fdov88@gmail.com>
Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-08-31 18:12:22 -04:00
Josh Puetz
d47d02f090
[deploy] Log in with Facebook (#9922)
* First draft of facebook auth

* Add Facebook welcome broadcast to seeds, data script

* Tests!

* Documentation

* Update docs with pictures

* User siteconfig/app config

* Adjust dropdown menu width to avoid wrap for Facebook button

* Add Facebook auth keys to SiteConfig properly

* Remove unnecessary VCR cassette

* Add omniauth facebook gem to vendor cache

* Use uid instead of email for nickname randomization

* Test fix, test for missing email in Facebook

* Update docs/backend/auth-facebook.md

Co-authored-by: Molly Struve <mollylbs@gmail.com>

* Typo fix!

* Don't default facebook auth settings to ApplicationConfig

Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-08-26 12:04:20 -04:00