From 645b818f6cf0adf0b25f74268d39a5f2ba7b51da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Geonizeli?= Date: Mon, 9 Aug 2021 22:07:48 -0300 Subject: [PATCH] use devise instead auth0 --- .env | 3 - Gemfile | 2 - Gemfile.lock | 10 -- app/controllers/application_controller.rb | 10 ++ app/controllers/concerns/authenticable.rb | 12 --- app/controllers/graphql_controller.rb | 7 +- app/javascript/packs/application.ts | 3 +- app/javascript/packs/react.ts | 1 - app/javascript/relay/environment.ts | 12 ++- app/javascript/src/App.tsx | 54 ++++++----- .../src/__generated__/AppQuery.graphql.ts | 97 +++++++++++++++++++ app/javascript/src/components/Navbar.tsx | 63 ------------ .../src/components/Navbar/Navbar.tsx | 75 ++++++++++++++ app/javascript/src/components/Navbar/index.ts | 1 + app/javascript/src/components/SideNav.tsx | 4 +- app/javascript/src/components/index.ts | 2 + .../{AppContext.tsx => AppProvider.tsx} | 4 +- app/javascript/src/contexts/AuthProvider.tsx | 24 ----- app/javascript/src/contexts/UserProvider.tsx | 32 ++++++ app/javascript/src/index.tsx | 13 ++- app/models/admin_user.rb | 2 - app/models/user.rb | 22 +++-- app/services/auth/auth0_client.rb | 20 ---- app/services/auth/authenticate.rb | 16 --- app/services/auth/profile.rb | 15 --- app/views/devise/confirmations/new.html.erb | 16 +-- .../mailer/confirmation_instructions.html.erb | 5 + .../devise/mailer/email_changed.html.erb | 7 ++ .../devise/mailer/password_change.html.erb | 3 + .../reset_password_instructions.html.erb | 8 ++ .../mailer/unlock_instructions.html.erb | 7 ++ app/views/devise/passwords/edit.html.erb | 25 +++-- app/views/devise/passwords/new.html.erb | 16 +-- app/views/devise/registrations/edit.html.erb | 48 +++++---- app/views/devise/registrations/new.html.erb | 41 +++++--- app/views/devise/sessions/new.html.erb | 28 +++--- .../devise/shared/_error_messages.html.erb | 15 +++ app/views/devise/shared/_links.html.erb | 42 ++++---- app/views/devise/unlocks/new.html.erb | 16 +-- app/views/layouts/application.html.erb | 8 -- config/initializers/i18n.rb | 2 + config/locales/pt-BR.yml | 5 + config/routes.rb | 1 + .../20210808153626_add_devise_to_users.rb | 36 +++++++ db/schema.rb | 9 +- package.json | 1 - spec/models/user_spec.rb | 19 ++-- yarn.lock | 56 +---------- 48 files changed, 519 insertions(+), 399 deletions(-) delete mode 100644 app/controllers/concerns/authenticable.rb delete mode 100644 app/javascript/packs/react.ts create mode 100644 app/javascript/src/__generated__/AppQuery.graphql.ts delete mode 100644 app/javascript/src/components/Navbar.tsx create mode 100644 app/javascript/src/components/Navbar/Navbar.tsx create mode 100644 app/javascript/src/components/Navbar/index.ts create mode 100644 app/javascript/src/components/index.ts rename app/javascript/src/contexts/{AppContext.tsx => AppProvider.tsx} (86%) delete mode 100644 app/javascript/src/contexts/AuthProvider.tsx create mode 100644 app/javascript/src/contexts/UserProvider.tsx delete mode 100644 app/services/auth/auth0_client.rb delete mode 100644 app/services/auth/authenticate.rb delete mode 100644 app/services/auth/profile.rb create mode 100644 app/views/devise/mailer/confirmation_instructions.html.erb create mode 100644 app/views/devise/mailer/email_changed.html.erb create mode 100644 app/views/devise/mailer/password_change.html.erb create mode 100644 app/views/devise/mailer/reset_password_instructions.html.erb create mode 100644 app/views/devise/mailer/unlock_instructions.html.erb create mode 100644 app/views/devise/shared/_error_messages.html.erb create mode 100644 config/initializers/i18n.rb create mode 100644 config/locales/pt-BR.yml create mode 100644 db/migrate/20210808153626_add_devise_to_users.rb diff --git a/.env b/.env index 237fcd1..e69de29 100644 --- a/.env +++ b/.env @@ -1,3 +0,0 @@ -AUTH_DOMAIN=dev-l56jkgi4.us.auth0.com -AUTH_CLIENT_ID=xuG9f6l8ewKSXdJozsT2Ps8bABtlLbRb -AUTH_AUDIENCE=https://xstake.com.br/ diff --git a/Gemfile b/Gemfile index 5a8db7b..d12bceb 100644 --- a/Gemfile +++ b/Gemfile @@ -16,13 +16,11 @@ gem "image_processing", "~> 1.12" gem "devise" gem "devise-i18n" -gem "devise-bootstrap-views" gem "administrate-field-active_storage" gem "tailwindcss-rails" gem "administrate" gem "enumerize" -gem "httparty" gem "graphql" gem "pundit" diff --git a/Gemfile.lock b/Gemfile.lock index bc77765..4d8f785 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -104,7 +104,6 @@ GEM railties (>= 4.1.0) responders warden (~> 1.2.3) - devise-bootstrap-views (1.1.0) devise-i18n (1.10.0) devise (>= 4.8.0) diff-lcs (1.4.4) @@ -121,9 +120,6 @@ GEM graphql (1.12.14) graphql_playground-rails (2.1.0) rails (>= 5.1.0) - httparty (0.18.1) - mime-types (~> 3.0) - multi_xml (>= 0.5.2) i18n (1.8.10) concurrent-ruby (~> 1.0) image_processing (1.12.1) @@ -155,9 +151,6 @@ GEM mini_mime (>= 0.1.1) marcel (1.0.1) method_source (1.0.0) - mime-types (3.3.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2021.0704) mini_magick (4.11.0) mini_mime (1.1.0) mini_portile2 (2.6.1) @@ -165,7 +158,6 @@ GEM momentjs-rails (2.20.1) railties (>= 3.1) msgpack (1.4.2) - multi_xml (0.6.0) nio4r (2.5.8) nokogiri (1.12.1) mini_portile2 (~> 2.6.1) @@ -331,13 +323,11 @@ DEPENDENCIES bootsnap (>= 1.4.4) capybara devise - devise-bootstrap-views devise-i18n dotenv-rails enumerize graphql graphql_playground-rails - httparty image_processing (~> 1.12) listen (~> 3.3) pg (~> 1.1) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 396f23e..b218fb5 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,4 +1,14 @@ # frozen_string_literal: true class ApplicationController < ActionController::Base include Pundit + + before_action :configure_devise_permitted_parameters, if: :devise_controller? + + protected + + def configure_devise_permitted_parameters + attributes = [:first_name, :last_name] + devise_parameter_sanitizer.permit(:sign_up, keys: attributes) + devise_parameter_sanitizer.permit(:account_update, keys: attributes) + end end diff --git a/app/controllers/concerns/authenticable.rb b/app/controllers/concerns/authenticable.rb deleted file mode 100644 index ddcc81e..0000000 --- a/app/controllers/concerns/authenticable.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true -module Authenticable - def current_auth - @current_auth ||= Auth::Authenticate.new(bearer_token).profile - end - - def bearer_token - pattern = /^Bearer / - header = request.headers["Authorization"] - header.gsub(pattern, "") if header&.match(pattern) - end -end diff --git a/app/controllers/graphql_controller.rb b/app/controllers/graphql_controller.rb index 06a9438..a524f70 100644 --- a/app/controllers/graphql_controller.rb +++ b/app/controllers/graphql_controller.rb @@ -1,16 +1,11 @@ # frozen_string_literal: true class GraphqlController < ApplicationController - include Authenticable - - protect_from_forgery with: :null_session - def execute variables = prepare_variables(params[:variables]) query = params[:query] operation_name = params[:operationName] context = { - current_auth: current_auth, - current_user: current_auth&.user, + current_user: current_user, } result = XStakeSchema.execute(query, variables: variables, context: context, operation_name: operation_name) render(json: result) diff --git a/app/javascript/packs/application.ts b/app/javascript/packs/application.ts index 42fe237..3e605ff 100644 --- a/app/javascript/packs/application.ts +++ b/app/javascript/packs/application.ts @@ -12,5 +12,6 @@ // Turbolinks.start() // ActiveStorage.start() -import "regenerator-runtime"; import "stylesheets/application"; +import "regenerator-runtime"; +import "../src/index"; diff --git a/app/javascript/packs/react.ts b/app/javascript/packs/react.ts deleted file mode 100644 index 3077918..0000000 --- a/app/javascript/packs/react.ts +++ /dev/null @@ -1 +0,0 @@ -import "../src/index"; diff --git a/app/javascript/relay/environment.ts b/app/javascript/relay/environment.ts index cdb1b08..92b1045 100644 --- a/app/javascript/relay/environment.ts +++ b/app/javascript/relay/environment.ts @@ -1,15 +1,21 @@ import type { Variables, RequestParameters, CacheConfig } from "relay-runtime"; import { Environment, Network, RecordSource, Store } from "relay-runtime"; -async function fetchRelay( +export const fetchRelay = async ( params: RequestParameters, variables: Variables, _cacheConfig: CacheConfig -) { +) => { + const csrfToken = + document + .querySelector('meta[name="csrf-token"]') + ?.getAttribute("content") ?? ""; + const response = await fetch("/graphql", { method: "POST", headers: { "Content-Type": "application/json", + "X-CSRF-Token": csrfToken, }, body: JSON.stringify({ query: params.text, @@ -30,7 +36,7 @@ async function fetchRelay( } return json; -} +}; export const environment = new Environment({ network: Network.create(fetchRelay), diff --git a/app/javascript/src/App.tsx b/app/javascript/src/App.tsx index 09018be..dfc300e 100644 --- a/app/javascript/src/App.tsx +++ b/app/javascript/src/App.tsx @@ -1,33 +1,37 @@ +import { graphql } from "babel-plugin-relay/macro"; import type { FC } from "react"; -import React, { Suspense } from "react"; -import { RelayEnvironmentProvider } from "react-relay"; -import { BrowserRouter as Router } from "react-router-dom"; +import React from "react"; +import { useLazyLoadQuery } from "react-relay"; -import { environment } from "../relay/environment"; -import { Navbar } from "./components/Navbar"; -import { SideNav } from "./components/SideNav"; -import { AppContext } from "./contexts/AppContext"; -import { AuthProvider } from "./contexts/AuthProvider"; +import { Navbar, SideNav } from "./components"; +import { AppProvider } from "./contexts/AppProvider"; +import { UserProvider } from "./contexts/UserProvider"; import { Routes } from "./Routes"; +import type { AppQuery } from "./__generated__/AppQuery.graphql"; export const App: FC = () => { + const { currentUser } = useLazyLoadQuery( + graphql` + query AppQuery { + currentUser { + firstName + } + } + `, + {} + ); + return ( - - - - - -
- -
- - -
-
-
-
-
-
-
+ + +
+ +
+ + +
+
+
+
); }; diff --git a/app/javascript/src/__generated__/AppQuery.graphql.ts b/app/javascript/src/__generated__/AppQuery.graphql.ts new file mode 100644 index 0000000..59c4f9e --- /dev/null +++ b/app/javascript/src/__generated__/AppQuery.graphql.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ConcreteRequest } from "relay-runtime"; +export type AppQueryVariables = {}; +export type AppQueryResponse = { + readonly currentUser: { + readonly firstName: string; + } | null; +}; +export type AppQuery = { + readonly response: AppQueryResponse; + readonly variables: AppQueryVariables; +}; + + + +/* +query AppQuery { + currentUser { + firstName + id + } +} +*/ + +const node: ConcreteRequest = (function(){ +var v0 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "firstName", + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": [], + "kind": "Fragment", + "metadata": null, + "name": "AppQuery", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "User", + "kind": "LinkedField", + "name": "currentUser", + "plural": false, + "selections": [ + (v0/*: any*/) + ], + "storageKey": null + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [], + "kind": "Operation", + "name": "AppQuery", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "User", + "kind": "LinkedField", + "name": "currentUser", + "plural": false, + "selections": [ + (v0/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "ecf2bf1a08ead5c3e2edb202242ed8cf", + "id": null, + "metadata": {}, + "name": "AppQuery", + "operationKind": "query", + "text": "query AppQuery {\n currentUser {\n firstName\n id\n }\n}\n" + } +}; +})(); +(node as any).hash = 'ea65c9caf86d93b8ddded2ae3eaa7b0e'; +export default node; diff --git a/app/javascript/src/components/Navbar.tsx b/app/javascript/src/components/Navbar.tsx deleted file mode 100644 index 49afaeb..0000000 --- a/app/javascript/src/components/Navbar.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import * as React from "react"; -import { useAuth0 } from "@auth0/auth0-react"; - -import XStakeLogo from "../images/logo.png"; -import { useAppContext } from "../contexts/AppContext"; - -export const Navbar = () => { - const { setSideNavExpanded } = useAppContext(); - - const handleExpandSideNav = () => { - setSideNavExpanded((prevState) => !prevState); - }; - - const { loginWithRedirect, logout, isAuthenticated } = useAuth0(); - - return ( - - ); -}; diff --git a/app/javascript/src/components/Navbar/Navbar.tsx b/app/javascript/src/components/Navbar/Navbar.tsx new file mode 100644 index 0000000..0f391a6 --- /dev/null +++ b/app/javascript/src/components/Navbar/Navbar.tsx @@ -0,0 +1,75 @@ +import * as React from "react"; + +import XStakeLogo from "../../images/logo.png"; +import { useApp } from "../../contexts/AppProvider"; +import { useCurrentUser } from "../../contexts/UserProvider"; + +const linkStyles = + "cursor-pointer hover:bg-gray-100 h-full px-4 font-bold flex items-center"; + +export const Navbar = () => { + const { setSideNavExpanded } = useApp(); + const handleExpandSideNav = () => { + setSideNavExpanded((prevState) => !prevState); + }; + + const { isAuthenticated } = useCurrentUser(); + + const csrfToken = + document + .querySelector('meta[name="csrf-token"]') + ?.getAttribute("content") ?? ""; + + return ( + + ); +}; diff --git a/app/javascript/src/components/Navbar/index.ts b/app/javascript/src/components/Navbar/index.ts new file mode 100644 index 0000000..2134800 --- /dev/null +++ b/app/javascript/src/components/Navbar/index.ts @@ -0,0 +1 @@ +export * from "./Navbar"; diff --git a/app/javascript/src/components/SideNav.tsx b/app/javascript/src/components/SideNav.tsx index 22ed697..62099c0 100644 --- a/app/javascript/src/components/SideNav.tsx +++ b/app/javascript/src/components/SideNav.tsx @@ -2,7 +2,7 @@ import * as React from "react"; import cx from "classnames"; import { Link } from "react-router-dom"; -import { useAppContext } from "../contexts/AppContext"; +import { useApp } from "../contexts/AppProvider"; type MenuItem = { label: string; @@ -25,7 +25,7 @@ const MenuItems: MenuItem[] = [ ]; export const SideNav = () => { - const { sideNavExpanded, setSideNavExpanded } = useAppContext(); + const { sideNavExpanded, setSideNavExpanded } = useApp(); const handleCloseSideNav = () => { setSideNavExpanded(false); diff --git a/app/javascript/src/components/index.ts b/app/javascript/src/components/index.ts new file mode 100644 index 0000000..9bb8c6e --- /dev/null +++ b/app/javascript/src/components/index.ts @@ -0,0 +1,2 @@ +export * from "./Navbar"; +export * from "./SideNav"; diff --git a/app/javascript/src/contexts/AppContext.tsx b/app/javascript/src/contexts/AppProvider.tsx similarity index 86% rename from app/javascript/src/contexts/AppContext.tsx rename to app/javascript/src/contexts/AppProvider.tsx index 5ef02b1..3227a51 100644 --- a/app/javascript/src/contexts/AppContext.tsx +++ b/app/javascript/src/contexts/AppProvider.tsx @@ -8,7 +8,7 @@ export type AppContext = { const Context = createContext(null); -export const useAppContext = (): AppContext => { +export const useApp = (): AppContext => { const context = useContext(Context); if (context === null) { @@ -18,7 +18,7 @@ export const useAppContext = (): AppContext => { return context; }; -export const AppContext: FC = ({ children }) => { +export const AppProvider: FC = ({ children }) => { const [sideNavExpanded, setSideNavExpanded] = useState(false); return ( diff --git a/app/javascript/src/contexts/AuthProvider.tsx b/app/javascript/src/contexts/AuthProvider.tsx deleted file mode 100644 index 6c590bd..0000000 --- a/app/javascript/src/contexts/AuthProvider.tsx +++ /dev/null @@ -1,24 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -import { Auth0Provider } from "@auth0/auth0-react"; -import type { FC } from "react"; -import React from "react"; - -export const AuthProvider: FC = ({ children }) => { - // @ts-ignore - const domain = window.AUTH_DOMAIN; - // @ts-ignore - const clientId = window.AUTH_CLIENT_ID; - // @ts-ignore - const audience = window.AUTH_AUDIENCE; - - return ( - - {children} - - ); -}; diff --git a/app/javascript/src/contexts/UserProvider.tsx b/app/javascript/src/contexts/UserProvider.tsx new file mode 100644 index 0000000..157fb7a --- /dev/null +++ b/app/javascript/src/contexts/UserProvider.tsx @@ -0,0 +1,32 @@ +import type { FC } from "react"; +import React, { createContext, useContext } from "react"; + +type CurrentUserContext = { + user: { + readonly firstName: string; + } | null; + isAuthenticated: boolean; +}; + +const Context = createContext({ + user: null, + isAuthenticated: false, +}); + +export const useCurrentUser = (): CurrentUserContext => { + const context = useContext(Context); + + return context; +}; + +type Props = { + user: { + readonly firstName: string; + } | null; +}; + +export const UserProvider: FC = ({ user, children }) => ( + + {children} + +); diff --git a/app/javascript/src/index.tsx b/app/javascript/src/index.tsx index 387c484..dd58eb2 100644 --- a/app/javascript/src/index.tsx +++ b/app/javascript/src/index.tsx @@ -1,12 +1,21 @@ -import React from "react"; +import React, { Suspense } from "react"; import ReactDOM from "react-dom"; +import { RelayEnvironmentProvider } from "react-relay"; +import { BrowserRouter as Router } from "react-router-dom"; +import { environment } from "../relay/environment"; import { App } from "./App"; document.addEventListener("DOMContentLoaded", () => { ReactDOM.render( - + + + + + + + , document.getElementById("root") ); diff --git a/app/models/admin_user.rb b/app/models/admin_user.rb index 3d62e8d..42aafae 100644 --- a/app/models/admin_user.rb +++ b/app/models/admin_user.rb @@ -19,8 +19,6 @@ # index_admin_users_on_reset_password_token (reset_password_token) UNIQUE # class AdminUser < ApplicationRecord - # Include default devise modules. Others available are: - # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable devise :database_authenticatable, :recoverable, :rememberable, :validatable end diff --git a/app/models/user.rb b/app/models/user.rb index 42f639c..29b0cfa 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -4,18 +4,26 @@ # # Table name: users # -# id :bigint not null, primary key -# email :string not null -# first_name :string not null -# last_name :string not null -# created_at :datetime not null -# updated_at :datetime not null +# id :bigint not null, primary key +# email :string default(""), not null +# encrypted_password :string default(""), not null +# first_name :string not null +# last_name :string not null +# remember_created_at :datetime +# reset_password_sent_at :datetime +# reset_password_token :string +# created_at :datetime not null +# updated_at :datetime not null # # Indexes # -# index_users_on_email (email) UNIQUE +# index_users_on_email (email) UNIQUE +# index_users_on_reset_password_token (reset_password_token) UNIQUE # class User < ApplicationRecord + devise :database_authenticatable, :registerable, + :recoverable, :rememberable, :validatable + has_many :documents, class_name: "UserDocument", dependent: :destroy validates :first_name, :last_name, :email, presence: true diff --git a/app/services/auth/auth0_client.rb b/app/services/auth/auth0_client.rb deleted file mode 100644 index 8d782b0..0000000 --- a/app/services/auth/auth0_client.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true -module Auth - class Auth0Client - class << self - def find_profile(token) - Profile.new(user_profile_attributes(token)) - end - - def user_profile_attributes(token) - HTTParty.get( - "https://#{ENV["AUTH_DOMAIN"]}/userinfo", - headers: { - "Content-Type" => "application/json", - "Authorization": "Bearer #{token}", - } - ).with_indifferent_access - end - end - end -end diff --git a/app/services/auth/authenticate.rb b/app/services/auth/authenticate.rb deleted file mode 100644 index b6d8838..0000000 --- a/app/services/auth/authenticate.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true -module Auth - class Authenticate - attr_reader :jwt_token - - def initialize(jwt_token) - @jwt_token = jwt_token - end - - def profile - return nil if jwt_token.blank? - - Auth0Client.find_profile(jwt_token) - end - end -end diff --git a/app/services/auth/profile.rb b/app/services/auth/profile.rb deleted file mode 100644 index d2866d3..0000000 --- a/app/services/auth/profile.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true -module Auth - class Profile - attr_reader :id, :email - - def initialize(attributes) - @id = attributes[:sub] - @email = attributes[:email] - end - - def user - @user ||= User.find_by(email: email) - end - end -end diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index cf9dc73..966a2eb 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/app/views/devise/confirmations/new.html.erb @@ -1,16 +1,16 @@ -

<%= t('.resend_confirmation_instructions') %>

+

<%= t('.resend_confirmation_instructions') %>

<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> - <%= bootstrap_devise_error_messages! %> + <%= render "devise/shared/error_messages", resource: resource %> -
- <%= f.label :email %> - <%= f.email_field :email, autofocus: true, autocomplete: 'email', value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email), class: 'form-control' %> +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
-
- <%= f.submit t('.resend_confirmation_instructions'), class: 'btn btn-primary' %> +
+ <%= f.submit t('.resend_confirmation_instructions') %>
<% end %> -<%= render 'devise/shared/links' %> +<%= render "devise/shared/links" %> diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb new file mode 100644 index 0000000..747fd87 --- /dev/null +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -0,0 +1,5 @@ +

<%= t('.greeting', recipient: @email) %>

+ +

<%= t('.instruction') %>

+ +

<%= link_to t('.action'), confirmation_url(@resource, confirmation_token: @token) %>

diff --git a/app/views/devise/mailer/email_changed.html.erb b/app/views/devise/mailer/email_changed.html.erb new file mode 100644 index 0000000..337c143 --- /dev/null +++ b/app/views/devise/mailer/email_changed.html.erb @@ -0,0 +1,7 @@ +

<%= t('.greeting', recipient: @email) %>

+ +<% if @resource.try(:unconfirmed_email?) %> +

<%= t('.message_unconfirmed', email: @resource.unconfirmed_email) %>

+<% else %> +

<%= t('.message', email: @resource.email) %>

+<% end %> diff --git a/app/views/devise/mailer/password_change.html.erb b/app/views/devise/mailer/password_change.html.erb new file mode 100644 index 0000000..a30313b --- /dev/null +++ b/app/views/devise/mailer/password_change.html.erb @@ -0,0 +1,3 @@ +

<%= t('.greeting', recipient: @resource.email) %>

+ +

<%= t('.message') %>

diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb new file mode 100644 index 0000000..6c22abf --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.html.erb @@ -0,0 +1,8 @@ +

<%= t('.greeting', recipient: @resource.email) %>

+ +

<%= t('.instruction') %>

+ +

<%= link_to t('.action'), edit_password_url(@resource, reset_password_token: @token) %>

+ +

<%= t('.instruction_2') %>

+

<%= t('.instruction_3') %>

diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb new file mode 100644 index 0000000..84d0981 --- /dev/null +++ b/app/views/devise/mailer/unlock_instructions.html.erb @@ -0,0 +1,7 @@ +

<%= t('.greeting', recipient: @resource.email) %>

+ +

<%= t('.message') %>

+ +

<%= t('.instruction') %>

+ +

<%= link_to t('.action'), unlock_url(@resource, unlock_token: @token) %>

diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb index acdc167..cf5d780 100644 --- a/app/views/devise/passwords/edit.html.erb +++ b/app/views/devise/passwords/edit.html.erb @@ -1,26 +1,25 @@ -

<%= t('.change_your_password') %>

+

<%= t('.change_your_password') %>

<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> - <%= bootstrap_devise_error_messages! %> + <%= render "devise/shared/error_messages", resource: resource %> <%= f.hidden_field :reset_password_token %> -
- <%= f.label :password, t('.new_password') %> - <%= f.password_field :password, autofocus: true, class: 'form-control' %> - +
+ <%= f.label :password, t('.new_password') %>
<% if @minimum_password_length %> - <%= t('devise.shared.minimum_password_length', count: @minimum_password_length) %> + <%= t('devise.shared.minimum_password_length', count: @minimum_password_length) %>
<% end %> + <%= f.password_field :password, autofocus: true, autocomplete: "new-password" %>
-
- <%= f.label :password_confirmation, t('.confirm_new_password') %> - <%= f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control' %> +
+ <%= f.label :password_confirmation, t('.confirm_new_password') %>
+ <%= f.password_field :password_confirmation, autocomplete: "new-password" %>
-
- <%= f.submit t('.change_my_password'), class: 'btn btn-primary' %> +
+ <%= f.submit t('.change_my_password') %>
<% end %> -<%= render 'devise/shared/links' %> +<%= render "devise/shared/links" %> diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index 37e3008..6c84368 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -1,16 +1,16 @@ -

<%= t('.forgot_your_password') %>

+

<%= t('.forgot_your_password') %>

<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> - <%= bootstrap_devise_error_messages! %> + <%= render "devise/shared/error_messages", resource: resource %> -
- <%= f.label :email %> - <%= f.email_field :email, autofocus: true, autocomplete: 'email', class: 'form-control' %> +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
-
- <%= f.submit t('.send_me_reset_password_instructions'), class: 'btn btn-primary' %> +
+ <%= f.submit t('.send_me_reset_password_instructions') %>
<% end %> -<%= render 'devise/shared/links' %> +<%= render "devise/shared/links" %> diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 411aff0..07e65b7 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -1,37 +1,43 @@ -

<%= t('.title', resource: resource_name.to_s.humanize) %>

+

<%= t('.title', resource: resource.model_name.human) %>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> - <%= bootstrap_devise_error_messages! %> + <%= render "devise/shared/error_messages", resource: resource %> -
- <%= f.label :email %> - <%= f.email_field :email, autofocus: true, autocomplete: 'email', class: 'form-control' %> +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
-
- <%= f.label :password %> - <%= f.password_field :password, autocomplete: 'new-password', class: 'form-control' %> + <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> +
<%= t('.currently_waiting_confirmation_for_email', email: resource.unconfirmed_email) %>
+ <% end %> - <%= t('.leave_blank_if_you_don_t_want_to_change_it') %> +
+ <%= f.label :password %> (<%= t('.leave_blank_if_you_don_t_want_to_change_it') %>)
+ <%= f.password_field :password, autocomplete: "new-password" %> + <% if @minimum_password_length %> +
+ <%= t('devise.shared.minimum_password_length', count: @minimum_password_length) %> + <% end %>
-
- <%= f.label :password_confirmation %> - <%= f.password_field :password_confirmation, autocomplete: 'new-password', class: 'form-control' %> +
+ <%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation, autocomplete: "new-password" %>
-
- <%= f.label :current_password %> - <%= f.password_field :current_password, autocomplete: 'current-password', class: 'form-control' %> - - <%= t('.we_need_your_current_password_to_confirm_your_changes') %> +
+ <%= f.label :current_password %> (<%= t('.we_need_your_current_password_to_confirm_your_changes') %>)
+ <%= f.password_field :current_password, autocomplete: "current-password" %>
-
- <%= f.submit t('.update'), class: 'btn btn-primary' %> +
+ <%= f.submit t('.update') %>
<% end %> -

<%= t('.unhappy') %>? <%= link_to t('.cancel_my_account'), registration_path(resource_name), data: { confirm: t('.are_you_sure') }, method: :delete %>.

+

<%= t('.cancel_my_account') %>

-<%= link_to t('.back'), :back %> +

<%= t('.unhappy') %> <%= button_to t('.cancel_my_account'), registration_path(resource_name), data: { confirm: t('.are_you_sure') }, method: :delete %>

+ +<%= link_to t('devise.shared.links.back'), :back %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 3a95df6..81f108a 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -1,30 +1,39 @@ -

<%= t('.sign_up') %>

+

<%= t('.sign_up') %>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> - <%= bootstrap_devise_error_messages! %> + <%= render "devise/shared/error_messages", resource: resource %> -
- <%= f.label :email %> - <%= f.email_field :email, autofocus: true, autocomplete: 'email', class: 'form-control' %> +
+ <%= f.label :first_name %>
+ <%= f.text_field :first_name, autofocus: true %>
-
+
+ <%= f.label :last_name %>
+ <%= f.text_field :last_name %> +
+ +
+ <%= f.label :email %>
+ <%= f.email_field :email, autocomplete: "email" %> +
+ +
<%= f.label :password %> - <%= f.password_field :password, autocomplete: 'current-password', class: 'form-control' %> - <% if @minimum_password_length %> - <%= t('devise.shared.minimum_password_length', count: @minimum_password_length) %> - <% end %> + <%= t('devise.shared.minimum_password_length', count: @minimum_password_length) %> + <% end %>
+ <%= f.password_field :password, autocomplete: "new-password" %>
-
- <%= f.label :password_confirmation %> - <%= f.password_field :password_confirmation, autocomplete: 'current-password', class: 'form-control' %> +
+ <%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation, autocomplete: "new-password" %>
-
- <%= f.submit t('.sign_up'), class: 'btn btn-primary' %> +
+ <%= f.submit t('.sign_up') %>
<% end %> -<%= render 'devise/shared/links' %> +<%= render "devise/shared/links" %> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 171f460..b350857 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,28 +1,26 @@ -

<%= t('.sign_in') %>

+

<%= t('.sign_in') %>

<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> -
- <%= f.label :email %> - <%= f.email_field :email, autofocus: true, autocomplete: 'email', class: 'form-control' %> +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
-
- <%= f.label :password %> - <%= f.password_field :password, autocomplete: 'current-password', class: 'form-control' %> +
+ <%= f.label :password %>
+ <%= f.password_field :password, autocomplete: "current-password" %>
<% if devise_mapping.rememberable? %> -
- <%= f.check_box :remember_me, class: 'form-check-input' %> - <%= f.label :remember_me, class: 'form-check-label' do %> - <%= resource.class.human_attribute_name('remember_me') %> - <% end %> +
+ <%= f.check_box :remember_me %> + <%= f.label :remember_me %>
<% end %> -
- <%= f.submit t('.sign_in'), class: 'btn btn-primary' %> +
+ <%= f.submit t('.sign_in') %>
<% end %> -<%= render 'devise/shared/links' %> +<%= render "devise/shared/links" %> diff --git a/app/views/devise/shared/_error_messages.html.erb b/app/views/devise/shared/_error_messages.html.erb new file mode 100644 index 0000000..ba7ab88 --- /dev/null +++ b/app/views/devise/shared/_error_messages.html.erb @@ -0,0 +1,15 @@ +<% if resource.errors.any? %> +
+

+ <%= I18n.t("errors.messages.not_saved", + count: resource.errors.count, + resource: resource.class.model_name.human.downcase) + %> +

+
    + <% resource.errors.full_messages.each do |message| %> +
  • <%= message %>
  • + <% end %> +
+
+<% end %> diff --git a/app/views/devise/shared/_links.html.erb b/app/views/devise/shared/_links.html.erb index 3c97f4c..d11c061 100644 --- a/app/views/devise/shared/_links.html.erb +++ b/app/views/devise/shared/_links.html.erb @@ -1,27 +1,25 @@ -
- <%- if controller_name != 'sessions' %> - <%= link_to t(".sign_in"), new_session_path(resource_name) %>
- <% end -%> +<%- if controller_name != 'sessions' %> + <%= link_to t(".sign_in"), new_session_path(resource_name) %>
+<% end %> - <%- if devise_mapping.registerable? && controller_name != 'registrations' %> - <%= link_to t(".sign_up"), new_registration_path(resource_name) %>
- <% end -%> +<%- if devise_mapping.registerable? && controller_name != 'registrations' %> + <%= link_to t(".sign_up"), new_registration_path(resource_name) %>
+<% end %> - <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> - <%= link_to t(".forgot_your_password"), new_password_path(resource_name) %>
- <% end -%> +<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> + <%= link_to t(".forgot_your_password"), new_password_path(resource_name) %>
+<% end %> - <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <%= link_to t('.didn_t_receive_confirmation_instructions'), new_confirmation_path(resource_name) %>
- <% end -%> +<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> + <%= link_to t('.didn_t_receive_confirmation_instructions'), new_confirmation_path(resource_name) %>
+<% end %> - <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> - <%= link_to t('.didn_t_receive_unlock_instructions'), new_unlock_path(resource_name) %>
- <% end -%> +<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> + <%= link_to t('.didn_t_receive_unlock_instructions'), new_unlock_path(resource_name) %>
+<% end %> - <%- if devise_mapping.omniauthable? %> - <%- resource_class.omniauth_providers.each do |provider| %> - <%= link_to t('.sign_in_with_provider', provider: OmniAuth::Utils.camelize(provider)), omniauth_authorize_path(resource_name, provider) %>
- <% end -%> - <% end -%> -
+<%- if devise_mapping.omniauthable? %> + <%- resource_class.omniauth_providers.each do |provider| %> + <%= link_to t('.sign_in_with_provider', provider: OmniAuth::Utils.camelize(provider)), omniauth_authorize_path(resource_name, provider), method: :post %>
+ <% end %> +<% end %> diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb index d70aa2f..e984257 100644 --- a/app/views/devise/unlocks/new.html.erb +++ b/app/views/devise/unlocks/new.html.erb @@ -1,16 +1,16 @@ -

<%= t('.resend_unlock_instructions') %>

+

<%= t('.resend_unlock_instructions') %>

<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> - <%= bootstrap_devise_error_messages! %> + <%= render "devise/shared/error_messages", resource: resource %> -
- <%= f.label :email %> - <%= f.email_field :email, autofocus: true, autocomplete: 'email', class: 'form-control' %> +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
-
- <%= f.submit t('.resend_unlock_instructions'), class: 'btn btn-primary'%> +
+ <%= f.submit t('.resend_unlock_instructions') %>
<% end %> -<%= render 'devise/shared/links' %> +<%= render "devise/shared/links" %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 32d043d..c82ff68 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -7,15 +7,7 @@ <%= csp_meta_tag %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> - - - <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> - <%= javascript_pack_tag 'react', 'data-turbolinks-track': 'reload' %> diff --git a/config/initializers/i18n.rb b/config/initializers/i18n.rb new file mode 100644 index 0000000..3773b1b --- /dev/null +++ b/config/initializers/i18n.rb @@ -0,0 +1,2 @@ +# frozen_string_literal: true +I18n.default_locale = "pt-BR" diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml new file mode 100644 index 0000000..e124d5d --- /dev/null +++ b/config/locales/pt-BR.yml @@ -0,0 +1,5 @@ +pt-BR: + administrate: + navigation: + sign_out: Encerrar sessão + sign_out_confirmation: Tem certeza que deseja encerrar a sessão? \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index ccf16ca..4fcf6a4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true Rails.application.routes.draw do + devise_for :users devise_for :admin_users namespace :admin do diff --git a/db/migrate/20210808153626_add_devise_to_users.rb b/db/migrate/20210808153626_add_devise_to_users.rb new file mode 100644 index 0000000..4b4bb69 --- /dev/null +++ b/db/migrate/20210808153626_add_devise_to_users.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +class AddDeviseToUsers < ActiveRecord::Migration[6.1] + def self.up + change_table(:users, bulk: true) do |t| + ## Database authenticatable + # t.string(:email, null: false, default: "") + t.string(:encrypted_password, null: false, default: "") + + ## Recoverable + t.string(:reset_password_token) + t.datetime(:reset_password_sent_at) + + ## Rememberable + t.datetime(:remember_created_at) + end + + change_column_default(:users, :email, "") + + # add_index(:users, :email, unique: true) + add_index(:users, :reset_password_token, unique: true) + end + + def self.down + change_column_default(:users, :email, nil) + + change_table(:users, bulk: true) do |t| + t.remove(:encrypted_password) + t.remove(:reset_password_token) + t.remove(:reset_password_sent_at) + t.remove(:remember_created_at) + end + + remove_index(:users, :reset_password_token) + end +end diff --git a/db/schema.rb b/db/schema.rb index edd001a..aba024e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2021_08_05_000225) do +ActiveRecord::Schema.define(version: 2021_08_08_153626) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -66,10 +66,15 @@ ActiveRecord::Schema.define(version: 2021_08_05_000225) do create_table "users", force: :cascade do |t| t.string "first_name", null: false t.string "last_name", null: false - t.string "email", null: false + t.string "email", default: "", null: false t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false + t.string "encrypted_password", default: "", null: false + t.string "reset_password_token" + t.datetime "reset_password_sent_at" + t.datetime "remember_created_at" t.index ["email"], name: "index_users_on_email", unique: true + t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true end add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id" diff --git a/package.json b/package.json index a4c1f00..71f6577 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "relay:watch": "relay-compiler --schema app/javascript/__generated__/schema.graphql --src app/javascript/src --extensions tsx --language typescript --watch" }, "dependencies": { - "@auth0/auth0-react": "^1.6.0", "@babel/preset-react": "^7.14.5", "@babel/preset-typescript": "^7.14.5", "@rails/actioncable": "^6.0.0", diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index d1af9d9..19aa188 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -4,16 +4,21 @@ # # Table name: users # -# id :bigint not null, primary key -# email :string not null -# first_name :string not null -# last_name :string not null -# created_at :datetime not null -# updated_at :datetime not null +# id :bigint not null, primary key +# email :string default(""), not null +# encrypted_password :string default(""), not null +# first_name :string not null +# last_name :string not null +# remember_created_at :datetime +# reset_password_sent_at :datetime +# reset_password_token :string +# created_at :datetime not null +# updated_at :datetime not null # # Indexes # -# index_users_on_email (email) UNIQUE +# index_users_on_email (email) UNIQUE +# index_users_on_reset_password_token (reset_password_token) UNIQUE # require "rails_helper" diff --git a/yarn.lock b/yarn.lock index 8a3ce9f..f088b5f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,26 +2,6 @@ # yarn lockfile v1 -"@auth0/auth0-react@^1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@auth0/auth0-react/-/auth0-react-1.6.0.tgz#9175d9d1ee3379aaaacfb6bed4640d56f239f59f" - integrity sha512-xjuNJnINMrJFbSpOSr9mjdVwfI9b+JbMKxoZy8R9Tmk3DGpBJ9eo69Im2RAeAWRISdrrxEZxNv9RAh9AQUvxEA== - dependencies: - "@auth0/auth0-spa-js" "^1.16.1" - -"@auth0/auth0-spa-js@^1.16.1": - version "1.16.1" - resolved "https://registry.yarnpkg.com/@auth0/auth0-spa-js/-/auth0-spa-js-1.16.1.tgz#fb35fe233bc1a39db5ce5694e75ed7a2779d5dbf" - integrity sha512-LosLwxKmLTVvy7dFwugVUwToRRwMetSgA8B+fHY0rq+hLtQr3mwZuEiu4T7NkmOzHTzGUWxLN38DkU6nYEG0Nw== - dependencies: - abortcontroller-polyfill "^1.7.1" - browser-tabs-lock "^1.2.13" - core-js "^3.11.0" - es-cookie "^1.3.2" - fast-text-encoding "^1.0.3" - promise-polyfill "^8.2.0" - unfetch "^4.2.0" - "@babel/code-frame@7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" @@ -1577,11 +1557,6 @@ resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== -abortcontroller-polyfill@^1.7.1: - version "1.7.3" - resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.3.tgz#1b5b487bd6436b5b764fd52a612509702c3144b5" - integrity sha512-zetDJxd89y3X99Kvo4qFx8GKlt6GsvN3UcRZHwU6iFA/0KiOmhkTVhe8oRoTBiTVPZu09x3vCra47+w8Yz1+2Q== - accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: version "1.3.7" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" @@ -2145,13 +2120,6 @@ brorand@^1.0.1, brorand@^1.1.0: resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= -browser-tabs-lock@^1.2.13: - version "1.2.14" - resolved "https://registry.yarnpkg.com/browser-tabs-lock/-/browser-tabs-lock-1.2.14.tgz#f4ba30810d20199a1858c102da1f91e339250728" - integrity sha512-ssSpCRcvFe4vc098LDnrJOQDfZiG35KhQGB9hthTbwJk5mmUkePwhcMlW61NH3YuIE2Y9uGLqf9yxEBKbaDlaw== - dependencies: - lodash ">=4.17.21" - browserify-aes@^1.0.0, browserify-aes@^1.0.4: version "1.2.0" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" @@ -2710,7 +2678,7 @@ core-js-pure@^3.16.0: resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.16.0.tgz#218e07add3f1844e53fab195c47871fc5ba18de8" integrity sha512-wzlhZNepF/QA9yvx3ePDgNGudU5KDB8lu/TRPKelYA/QtSnkS/cLl2W+TIdEX1FAFcBr0YpY7tPDlcmXJ7AyiQ== -core-js@^3.11.0, core-js@^3.12.1: +core-js@^3.12.1: version "3.16.0" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.16.0.tgz#1d46fb33720bc1fa7f90d20431f36a5540858986" integrity sha512-5+5VxRFmSf97nM8Jr2wzOwLqRo6zphH2aX+7KsAUONObyzakDNq2G/bgbhinxB4PoV9L3aXQYhiDKyIKWd2c8g== @@ -3407,11 +3375,6 @@ es-abstract@^1.17.2, es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es- string.prototype.trimstart "^1.0.4" unbox-primitive "^1.0.1" -es-cookie@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/es-cookie/-/es-cookie-1.3.2.tgz#80e831597f72a25721701bdcb21d990319acd831" - integrity sha512-UTlYYhXGLOy05P/vKVT2Ui7WtC7NiRzGtJyAKKn32g5Gvcjn7KAClLPWlipCtxIus934dFg9o9jXiBL0nP+t9Q== - es-to-primitive@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" @@ -3883,11 +3846,6 @@ fast-levenshtein@^2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= -fast-text-encoding@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz#ec02ac8e01ab8a319af182dae2681213cfe9ce53" - integrity sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig== - fastq@^1.6.0: version "1.11.1" resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.11.1.tgz#5d8175aae17db61947f8b162cfc7f63264d22807" @@ -5277,7 +5235,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@>=4.17.21, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.21, lodash@^4.17.5: +lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.21, lodash@^4.17.5: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -6992,11 +6950,6 @@ promise-inflight@^1.0.1: resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= -promise-polyfill@^8.2.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-8.2.0.tgz#367394726da7561457aba2133c9ceefbd6267da0" - integrity sha512-k/TC0mIcPVF6yHhUvwAp7cvL6I2fFV7TzF1DuGPI8mBh4QQazf36xCKEHKTZKRysEoTQoQdKyP25J8MPJp7j5g== - promise@^7.1.1: version "7.3.1" resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" @@ -8525,11 +8478,6 @@ unbox-primitive@^1.0.1: has-symbols "^1.0.2" which-boxed-primitive "^1.0.2" -unfetch@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.2.0.tgz#7e21b0ef7d363d8d9af0fb929a5555f6ef97a3be" - integrity sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA== - unicode-canonical-property-names-ecmascript@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818"