Commit graph

45 commits

Author SHA1 Message Date
PJ
47deeefe57
Optionally limit new users based on admin setting (#20149)
* create admin setting for new user status

* limiting on signup working 🎉

* update registration specs

* sort out OAuth registrations
2023-09-26 10:46:36 +01:00
Rajat Talesra
a679486572
Redesign sign-up and login pages (#20065)
* Signin Signup screen update

* Design for signin signup finished

* On hover effect

* Fixed few tests

* Fixed rSpec tests

* Minor design fixes

* Design changes suggested by Anuj

* Test fixes

* Updated test

* Nit fixes

* Path changes and footer and topbar hidden

* A bit simplified css

* Removed custom css

* Updated tests

* Nit css fixes

* Updates as per Ridhwana's review

* CSS fixes

* Used js-registration
2023-09-13 21:46:57 +05:30
Anna Buianova
7d053471f8
Rubocop fixes in spec/requests (#18946)
* Rubocop fixes in spec/requests

* Fixed spec/requests/api/v0/articles_spec.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-01-12 19:10:16 +03:00
Mac Siri
678dda8cf4
Routine Rubopcop lint fixes (#17844)
* Routine Rubopcop lint fixes

* Undo app_secrets_spec changes

* Fix broken spec
2022-06-07 10:17:16 -04:00
Mac Siri
9be5c8c6b0
Routine Rubocop fixes (#16838) 2022-03-09 09:32:50 -05:00
Julianna Tetreault
8d00e27b69
Remove Creator Onboarding Feature Flags from Codebase (#15982)
* Removes FeatureFlag.enabled?(:creator_onboarding) from codebase

* Removes FeatureFlag.enabled?(:creator_onboarding) from specs

* Further cleanup, removal, and spec fixes

* Fixes the user_request_confirmation_spec.rb

* Reverts change to confirmation email button

* Revert revert after looking at designs again :(

* Removes redundant logo_png field from config + fixes test

* Rewords an expectation in user_uses_the_editor_spec.rb

* Revert removal of logo_png from Config images

* Removes CSS class from user_uses_the_editor_spec.rb

* Removes test from user_uses_the_editor_sepc.rb

* Removes unnecessary else from _logo.html.erb

* Adds back removed system spec

* Removes SVG-related code from _logo.html.erb

* Removes AsyncInfoController#use_creator_onboarding

* Fixes spec failues due to removed code

* Removes svg-related code (that I thought I removed already :/ )

* Re-removes FeatureFlag and logo_svg from _images.html.erb

* Remove newest instances of FeatureFlag(:creator_onboarding)

* remove instances where we use the creator_onboarding field from the base_data

* fix: redirect to the correct path in the reguistrations controller based on whether the user is a creator or not

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2022-01-31 11:30:43 -07:00
Jeremy Friesen
a40efc6bbd
Refactoring questions asked of user (#15762)
* Refactoring questions asked of user

In this pull request, I'm extracting and normalizing role-based
questions asked of the user.

Prior to this commit, our codebase has asked two very similar questions
of our user model:

- `user.has_role?(:admin)`
- `user.admin?`

In asking `has_role?(:admin)` we are relying on implementation details
of the rolify gem.  In addition, the `has_role?` question asked
throughout controllers or views means that it's harder to create
hieararchies of permissions.

In favoring `user.admin?` as our question, we can use that indirection
as an opportunity to discuss and decide "Should someone with the
`:super_admin` role be `user.admin? == true`?"

The details of this commit is to do three primary things:

1. Ask the `has_role?` questions in "one place" in the code (e.g. the
   `Authorizer` module)
2. Extract the role based questions that are on the `User` model and
   provde backwards compatable delegation.
3. Structure the code so that it's harder to accidentally call
   `user.has_role?` (e.g., make `User#has_role?` and `User#has_any_role?`
   private).

This is related to #15624 and the updates are informed by discussion in
PR #15691.  This commit supplants #15691.

* Refactoring the liquid tag policy tests

* Fixing typo

* Bump for travis
2021-12-21 12:45:12 -05:00
Josh Soref
0403e78f08
Spelling (#15702)
* spelling: access

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: additional

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: administrative

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: aggregate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: assigns

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: attributes

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: autocomplete

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: because

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: between

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: bootstrap

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: calculating

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: captcha

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: character

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: chosen

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: commenter

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: competitor

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: componentize

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: contrast

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: corresponding

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: description

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: destroyed

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: destroys

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: discussion

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: episode

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: escaped

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: evaluates

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: expired

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: explicitly

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: facebook

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: fragment

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: functionality

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: improper

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: incentive

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: interfere

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: latest

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: message

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: minimum

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: moderator

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: mouseover

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: mutual

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: notification

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: occasionally

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: occurrence

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: occurs

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: octokit

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: offset

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: omitted

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: opacity

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: organization

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: organizations

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: overridden

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: override

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: overriding

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: prefill

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: previous

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: profile

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: recycling

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: registered

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: repositories

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: rescuing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: response

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: returns

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: second

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: separator

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: services

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: subscriber

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: subscription

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: success

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: successful

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: successfully

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: suppress

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: test

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: thought

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: uniqueness

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unknown

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unproductive

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unreachable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unsuccessful

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: utilities

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: utility

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: valid

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: voluntarily

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: vomited

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: website

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: withholding

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-12-07 06:59:10 -07:00
yheuhtozr
cca3bed043
views/shared/authentication etc i18n (#15131)
* views/shared/authentication etc i18n

* remove ja.yml

* Update _providers_registration_form.html.erb

* Update registrations_spec.rb

* Update _email_registration_form.html.erb

* Update _forem_creator_signup.html.erb

* Update spec/requests/registrations_spec.rb

Co-authored-by: Michael Kohl <citizen428@forem.com>

* Update dashboard_spec.rb

* Update dashboard_spec.rb

* Update _forem_creator_signup.html.erb

* Update _forem_creator_signup.html.erb

Co-authored-by: Michael Kohl <citizen428@forem.com>
2021-12-01 18:56:33 +02:00
Ben Halpern
3f921ec9c6
Fix profile image bug on email registration (#14991) 2021-10-08 14:30:57 -04:00
Alex
eed3c12f4d
Auto register Forems on Discover (#14962) 2021-10-06 10:51:15 -04:00
Ridhwana
5827be4ecc
RFC 190: Forem Creator Signup Page (#13875)
* chore: add my name to the chaore so that I can search after cleanup

* feat: update the forem creator signup template and copy over some stuff from the email_resgistration

* feat: update the fields

* feat: make sure that it saves

* feat: add an eye svg to the password input

* feat: update eye and eye-off svg

* feat: update the placeholder for the password field

* reveak and hide the password when clicking on the icon

* eye visiblibility functionality

* feat: display the username

* feat: show the username row when we click edit

* feat: update the interaction design

* chore: remove extra line

* chore: remove unneeded function

* feat: never show the username hint when the user field is not hidden

* feat: ensure that the username works

* chore: update the existing specs

* feat: move to packs

* refactor: manage the visibility with a avariable and not with the password type

* optimize the way we use password visibility

* chore: validate the username field

* chore: update the statement

* feat: add a background

* feat: accessibility changes

* feat: set a max length on the username

* feat: some more accessibility changes

* feat: validate the length of the password

* chore: add some margin to the error box

* feat: by_email shows the error states and we should cater for the Forem Creator

* feat: tackle any errors

* WIP/test: first pass of some integration specs

* feat: update the Cypress tests

* Update app/views/shared/authentication/_forem_creator_signup.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/shared/authentication/_forem_creator_signup.html.erb

Co-authored-by: Michael Kohl <me@citizen428.net>

* chore: temporarily disable the background on large screens

* chore: remove title

* prevent default

* feat; update the style of the button

* feat: update the tests to use accessibility tags

* feat: update icons

* chore: oops

* little forntend updates

* Update app/views/shared/authentication/_forem_creator_signup.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update cypress/integration/creatorOnboardingFlows/creatorSignup.spec.js

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

* fea: change the aria label and pressed

* feat: change to just John

* feat: update  cypress tests

* test if this is causing the test to fail

* feat: add some margin

* feat: mostly for Cypress - required is true or false based on whether the field is needed

* refactor: use the password label and skip last test

* Update app/views/shared/authentication/_forem_creator_signup.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/shared/authentication/_forem_creator_signup.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* fix: do not toggle  the label (accessibility)

* fix: add a comma

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Michael Kohl <me@citizen428.net>
Co-authored-by: Paweł Ludwiczak <ludwiczakpawel@gmail.com>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2021-08-24 10:33:26 +02:00
Fernando Valverde
e73afa22c7
Take Apple Authentication out of Beta (#12114)
* Removing :apple_auth feature flag and debugging

* Fix tests failing due to nil in Devise initializer

* Remove db/schema.rb changes

* Devise config tweak

* cleaning up

* Fix spec + delete debug logs

* Removes temporary beta_access_providers spec + remove feature flag DUS

* Add test to avoid connecting an existing user with SIWA

* Fix merge conflict mistake + more feature flag cleanups
2021-08-03 15:04:00 -06:00
Fernando Valverde
16ddcb74dc
Avoid showing social login options in ForemWebView (#14260)
* Minimal diff commit

* Add helper specs for display_social_login?

* Fixing some specs

* Fixing specs

* Add system specs for flow A vs flow B

* Add aria-live polite

* revert unnecessary change to spec

* Update spec/system/authentication/conditional_registration_spec.rb

Co-authored-by: rhymes <github@rhymes.dev>

* Tweaks to fix specs

* Apply review feedback

* Apply suggestions from code review

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Extract helper function + refactor Regexp from display_social_login?

* Small tweak to condition

Co-authored-by: rhymes <github@rhymes.dev>
Co-authored-by: Michael Kohl <citizen428@dev.to>
2021-07-21 09:59:12 -06:00
Fernando Valverde
7845423bb9
Remove :runtime_banner feature flag (#13662)
* Removes :runtime_banner feature flag + repositioning

* Switch to https://udl.forem.com + fix spec

* Fix URL specs

* Adds data_update_script to remove feature flag

* Fix banner overlay on reactions for small screens + iPad max width

* Append -only to Runtime Filter CSS

* Add import to fix assets:precompile

* Implement design update

* Apply suggestions from code review

Co-authored-by: Lisa Sy <lisasyis@gmail.com>

* Add ;

* Trigger Travis

Co-authored-by: Lisa Sy <lisasyis@gmail.com>
2021-05-28 15:10:15 -06:00
Michael Kohl
6dfabd578f
Rename SiteConfig to Settings::General (#13573)
* Rename SiteConfig

* More renaming

* Update spec

* Update mandatory settings mapping

* More renaming

* e2e test fixes

* You have a rename, and you have a rename

* Spec fix

* More changes

* Temporarily disable specs

* After-merge update

* Undo rename for migration

* undo rename of DUS

* Fix DUS

* Fix merge problem

* Remove redundant DUS

* Fix specs

* Remove unused code

* Change wrong class name

* More cleanup

* Re-add missing values to constant

* Fix constant

* Fix spec

* Remove obsolete fields

* Add accidentally removed field

* Update spec

* Move methods from Settings::General to ForemInstance

* Remove unneeded model

* Change mentions of 'site config'
2021-05-21 14:45:37 +02:00
Michael Kohl
111b7316d9
Remove mascot footer image (#13642)
* Remove footer mascot image

* Move remaining mascot settings back to SiteConfig

* Add data update script

* Update usages

* Fix path

* Remove dead route

* Update tests

* Fix view and spec

* Fix e2e test

* Fix DUS
2021-05-11 13:55:18 +02:00
Mac Siri
cf538f83c8
Fix invalid form during Creator onboarding. (#13673) 2021-05-05 16:14:48 -04:00
Andy Zhao
9970b1c2d5
Auto generate profile image for email signups (#13635)
* Add required tooltips and asterisks to fields

* Generate profile image for email signups

* Use be over eq

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Use path helpers over hard-coded paths

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Add labels to make it more accessible

* Stub it all... eek

* stub some more stuff

* stub stub stub

* Move aria label to proper label and fix tests

Co-authored-by: Michael Kohl <citizen428@dev.to>
2021-05-05 12:08:24 -04:00
Ridhwana
3a4da2dd5a
RFC 50: Remove hardcoded paths and use path_helpers instead (in the specs) (#13549)
* feat: update the paths in the spec files

* feat: update hardcoded paths with path helpers

* chore: update hardcoded paths to path helpers

* chore: hardcode describe blocks

* chore: oops

* feat: update some more hardcoded to use link_to's

* fix broken tests

* chore: admin_articles path

* chore: oops remove rails helper

* feat: add starting /

* chore: more pre slashes

* chore: add pre slashes

* chore: some small typos

* fix: oops
2021-04-28 21:32:51 +02:00
Michael Kohl
f2f5e911cf
Add Settings::Mascot (#13451)
* Add Settings::Mascot

* Add DUS

* Update usage

* Fix e2e test and controller

* Fix specs

* Fix remaining spec
2021-04-26 11:39:19 +07:00
Michael Kohl
5406b0576e
Split Settings::Authentication from SiteConfig (#13095)
* Split Settings::Authentication from SiteConfig

* Move specs

* Sort fields

* Update settings usages

* Update recaptcha usages

* Add data update script

* Update spec

* Rename SiteConfigParams concern

* Fixes, new route, new controller

* Controller and service refactoring

* More controller and service updates

* Spec updates

* More spec fixes

* Move file

* Fix FeedbackMessagesController

* Update admin/configs_spec

* Fix remaining specs in admin/configs_spec

* Fix configs API

* Formatting

* Clean up old service object

* Various fixes

* Update DUS

* Add model argument to admin_config_label

* Fix key name

* Fix specs

* Add distinct request caches for settings classes

* Fix e2e tests

* Fix remaining system spec

* Make DUS idempotent

* Move routes block

* Cleanup

* Switch to ActiveSupport::CurrentAttributes

* Pinned rails-settings-cached

* Update e2e test

* Update lib/data_update_scripts/20210316091354_move_authentication_settings.rb

Co-authored-by: rhymes <rhymes@hey.com>

* Add guard to DUS

* Temporarily re-add two SiteConfig fields

* Fix config show view

Co-authored-by: rhymes <rhymes@hey.com>
2021-04-12 09:41:09 +02:00
Fernando Valverde
f0b8754d4f
Feature: Runtime Content Filter (#13007)
* Working version of Runtime Filter with banner behind Feature Flag

* First attempt to add a cypress test

* Adds simplified test

* Cleanup global references

* Add multi-platform e2e test

* Use --runtime-display var with fallback to block

* Update app/assets/javascripts/initializers/runtime.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Add FeatureFlag stub to fix unrelated specs

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-03-25 12:04:45 -06:00
Ben Halpern
972cc6cc05
Remove config single resource admin from config logic (#11971)
* Remove config single resource admin from config logic

* Remove single resource admin test
2020-12-18 13:09:31 -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
Vaidehi Joshi
a658406b5c
Ensure first user of a Forem has a trusted role (#11700) 2020-12-02 08:44:35 -08:00
Fernando Valverde
494af84e83
Refactor reCaptcha code and bypass in report abuse for trustworthy users only (#10502)
* Bypass recaptcha for authenticated users abuse reports

* Moves bypass_recaptcha? to helper method to have one definition of the criteria for this

* User must be 1 month old at least in order to bypass_recaptcha?

* Fixes test

* Better spec message

* Bypasses auditable users

* Adds better test coverage over recaptcha bypass cases

* include Helper removed from FeedbackMessagesController

* Adds some inline comments for clarity and banned check
2020-12-02 08:55:47 -06:00
Ben Halpern
f3a69bbd84
Allow Forems to specify which domains are allowed for registration (#11442)
* Allow authors to restrict which emails can sign up

* Add form and tests

* Check for email presence in allowed email flow

* Fix test domains

* Fix codeclimate issue
2020-11-17 08:43:46 -05:00
Alex
99c3fb276d
Auto generate mascot accounts (#11380)
* Auto generate mascot accounts

* Refactor to remove extra query

* Update registration specs

* Fix search query spec

* Fix reaction specs

* Create with bang and raise error
2020-11-12 16:33:16 -05:00
rhymes
1bb53651b0
Replace calls to Flipper with FeatureFlag (#11386) 2020-11-12 14:15:33 +01:00
Jacob Herrington
d479834344
Do not set SiteConfig values in specs (#11125) 2020-10-27 15:56:31 -04:00
Vaidehi Joshi
d008f89399
Forem creator feature flag + onboarding signup form (#11031)
* Add initial forem creator signup form

* Fix label typos in various stylesheets :)
2020-10-23 10:52:21 -04:00
Ben Halpern
2d75d6d5ea
Fix missing registration data change (#11008)
* Fix missing registration acknowledgment

* Add backfill script and seeds adjustment

* Update lib/data_update_scripts/20201022161311_backfill_user_registrations_in_registrations_controller_path.rb

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

Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-10-22 19:21:03 -04:00
Alex
7e9447ccd1
Add forem_owner_secret to params (#10938)
* Add forem_owner_secret to params

* Add forem_owner_secret to safe_params_list
2020-10-19 16:43:21 -04:00
Arit Amana
8e57cf17ad
[Team Email Login] Admin enable/disable recaptcha during email signup (#10846)
* Initial Implementation

* Complete hookup of recaptcha guard

* Write tests for recaptcha during email signup

* Addressing PR changes 1

* Create helper method and write specs

* fix bug
2020-10-19 16:20:18 -04:00
Ben Halpern
b5f20c0a46
Make allow email password login default true (#10838)
* Make allow email password login default true

* Change test
2020-10-14 13:34:01 -04:00
Arit Amana
f4bd1df21c
[Email/Password Authentication] Allow Admins to enable email/password login (#10745)
* Implement Admins ability to allow email login

* Write specs for admin allow email login

* Fix specs causing builds to fail

* Fix spec causing builds to fail

* Use dummyimage.com for spec images

Co-authored-by: Josh Puetz <joshpuetz@gmail.com>

* Use dummyimage.com

* refactor setting of SiteConfig attributes

* Address PR review comments

* fix indentation

* Use "allow to receive and return" approach for other specs

Co-authored-by: Josh Puetz <joshpuetz@gmail.com>
2020-10-12 12:54:35 -04:00
Josh Puetz
37b40c9b04
Link Email Account creation UI to existing Create Account UI (#10746) [deploy]
* Conditional button to link to email accout creation

* Rename email signup state param

* Test for email account creation button scenarios
2020-10-09 10:29:09 -05: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
Ben Halpern
7ba7d9fc46
Add logic for asking for FOREM_OWNER_SECRET to be present on first user sign up if set by system (#10108)
* Add logic for requiring FOREM_OWNER_SECRET to be present

* Fix test logic
2020-08-31 16:41:30 -04:00
Lisa Sy
5ff2ad7437
Update main authentication view to improve visual design (#9856) [deploy]
* Update mobile version of /new registration view

* Optimize styles for desktop view

* Fix typo

* Fix typo

* Add twemojis in footer area

* Update messaging to fulfill all intents

* cache

* cache

* hr-label fix on mobile

* hr-label fix on mobile

* crayons for checkbox

* crayons for checkbox

* remove old styles

* move signin to appropriate folder

* Remove schema changes

* Fix registraction specs and hide password hint for no SSO enabled

* Disable email hint for password reset page

* Fix specs

* Revert "Disable email hint for password reset page"

This reverts commit b33a6dda4c13534541294281f83f7ad5a4864c0d.

* Transfer User.registered.estimated_count to the controller

* Fix import path

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: rhymes <rhymes@hey.com>
2020-08-31 09:55:27 -07:00
Ben Halpern
dba151915b
[deploy] Allow initial user to sign up and configure app (#10073)
* Allow initial user to sign up and configure app

* Fix added value unneeded

* Make siteconfig public in tests

* Remove deprecated method and adjust seed default

* Add new controllers not to redirect for public

* Modify tests

* Edit test defaults

* Fix linting

* Add starter mode to seed file
2020-08-31 12:54:22 -04:00
Ben Halpern
0dd04ea45a
Create initial "register by email and password" beta/MVP in prep for "setup mode" (#10039)
* Modify registrations controller

* A bit of progress

* More work

* a bit pf progress on confirmation emails

* Get basic functionality in place

* Remove comments

* First basic test

* Add tests

* Fix code styles

* Remove sessions spec

* Remove sessions spec

* Remove extra markup
2020-08-28 09:46:56 -04:00
Ben Halpern
da6a6739e5
[deploy] Invite users to join and create password (#9294)
* Initial invitation work

* Add more invitation code

* Add proper registration page

* Fix up tests

* Fix failings

* Fix spec

* Add self-serve auth config

* Add registered condition

* Change profile image call and registered_at test

* Change comment

* Fix copy test

* Stub emojipedia

* Linting

* Add registered at to factory

* Ensure registered for user tag

* Update app/views/internal/invitations/index.html.erb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update app/controllers/internal/invitations_controller.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Slight changes

* Update recover password flow

* Update app/views/internal/invitations/index.html.erb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update app/controllers/internal/invitations_controller.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update db/schema.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>
2020-07-15 11:37:19 -04:00
rhymes
8407bf9b4e
[deploy] Authentication refactoring: cleanups (#7576)
* Use Devise registry to list available providers

* Cleanups following Devise+Omniauth docs

* More cleanups

* Use helpers

* More cleanups

* Oops, forgot to remove these specs
2020-04-29 10:33:30 -04:00
Renamed from spec/requests/registration_spec.rb (Browse further)