devise_token_auth 0.1.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/LICENSE +13 -0
- data/README.md +97 -0
- data/Rakefile +12 -4
- data/app/controllers/devise_token_auth/application_controller.rb +89 -22
- data/app/controllers/devise_token_auth/concerns/resource_finder.rb +58 -0
- data/app/controllers/devise_token_auth/concerns/set_user_by_token.rb +199 -0
- data/app/controllers/devise_token_auth/confirmations_controller.rb +79 -14
- data/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb +284 -0
- data/app/controllers/devise_token_auth/passwords_controller.rb +196 -35
- data/app/controllers/devise_token_auth/registrations_controller.rb +191 -20
- data/app/controllers/devise_token_auth/sessions_controller.rb +130 -21
- data/app/controllers/devise_token_auth/token_validations_controller.rb +31 -0
- data/app/controllers/devise_token_auth/unlocks_controller.rb +94 -0
- data/app/models/devise_token_auth/concerns/active_record_support.rb +18 -0
- data/app/models/devise_token_auth/concerns/confirmable_support.rb +28 -0
- data/app/models/devise_token_auth/concerns/mongoid_support.rb +19 -0
- data/app/models/devise_token_auth/concerns/tokens_serialization.rb +31 -0
- data/app/models/devise_token_auth/concerns/user.rb +287 -0
- data/app/models/devise_token_auth/concerns/user_omniauth_callbacks.rb +35 -0
- data/app/validators/devise_token_auth_email_validator.rb +31 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/devise_token_auth/omniauth_external_window.html.erb +38 -0
- data/config/locales/da-DK.yml +52 -0
- data/config/locales/de.yml +51 -0
- data/config/locales/en.yml +60 -0
- data/config/locales/es.yml +51 -0
- data/config/locales/fa.yml +60 -0
- data/config/locales/fr.yml +51 -0
- data/config/locales/he.yml +52 -0
- data/config/locales/it.yml +48 -0
- data/config/locales/ja.yml +60 -0
- data/config/locales/ko.yml +51 -0
- data/config/locales/nl.yml +32 -0
- data/config/locales/pl.yml +51 -0
- data/config/locales/pt-BR.yml +48 -0
- data/config/locales/pt.yml +51 -0
- data/config/locales/ro.yml +48 -0
- data/config/locales/ru.yml +52 -0
- data/config/locales/sq.yml +48 -0
- data/config/locales/sv.yml +52 -0
- data/config/locales/uk.yml +61 -0
- data/config/locales/vi.yml +52 -0
- data/config/locales/zh-CN.yml +48 -0
- data/config/locales/zh-HK.yml +50 -0
- data/config/locales/zh-TW.yml +50 -0
- data/lib/devise_token_auth/blacklist.rb +6 -0
- data/lib/devise_token_auth/controllers/helpers.rb +157 -0
- data/lib/devise_token_auth/controllers/url_helpers.rb +10 -0
- data/lib/devise_token_auth/engine.rb +100 -0
- data/lib/devise_token_auth/errors.rb +8 -0
- data/lib/devise_token_auth/rails/routes.rb +135 -0
- data/lib/devise_token_auth/token_factory.rb +126 -0
- data/lib/devise_token_auth/url.rb +44 -0
- data/lib/devise_token_auth/version.rb +3 -1
- data/lib/devise_token_auth.rb +11 -2
- data/lib/generators/devise_token_auth/USAGE +27 -4
- data/lib/generators/devise_token_auth/install_generator.rb +91 -0
- data/lib/generators/devise_token_auth/install_generator_helpers.rb +98 -0
- data/lib/generators/devise_token_auth/install_mongoid_generator.rb +46 -0
- data/lib/generators/devise_token_auth/install_views_generator.rb +18 -0
- data/lib/generators/devise_token_auth/templates/devise_token_auth.rb +66 -0
- data/lib/generators/devise_token_auth/templates/devise_token_auth_create_users.rb.erb +49 -0
- data/lib/generators/devise_token_auth/templates/user.rb.erb +9 -0
- data/lib/generators/devise_token_auth/templates/user_mongoid.rb.erb +56 -0
- data/lib/tasks/devise_token_auth_tasks.rake +2 -0
- data/test/controllers/custom/custom_confirmations_controller_test.rb +25 -0
- data/test/controllers/custom/custom_omniauth_callbacks_controller_test.rb +33 -0
- data/test/controllers/custom/custom_passwords_controller_test.rb +79 -0
- data/test/controllers/custom/custom_registrations_controller_test.rb +63 -0
- data/test/controllers/custom/custom_sessions_controller_test.rb +39 -0
- data/test/controllers/custom/custom_token_validations_controller_test.rb +42 -0
- data/test/controllers/demo_group_controller_test.rb +151 -0
- data/test/controllers/demo_mang_controller_test.rb +313 -0
- data/test/controllers/demo_user_controller_test.rb +658 -0
- data/test/controllers/devise_token_auth/confirmations_controller_test.rb +275 -0
- data/test/controllers/devise_token_auth/omniauth_callbacks_controller_test.rb +438 -0
- data/test/controllers/devise_token_auth/passwords_controller_test.rb +893 -0
- data/test/controllers/devise_token_auth/registrations_controller_test.rb +920 -0
- data/test/controllers/devise_token_auth/sessions_controller_test.rb +605 -0
- data/test/controllers/devise_token_auth/token_validations_controller_test.rb +142 -0
- data/test/controllers/devise_token_auth/unlocks_controller_test.rb +235 -0
- data/test/controllers/overrides/confirmations_controller_test.rb +47 -0
- data/test/controllers/overrides/omniauth_callbacks_controller_test.rb +53 -0
- data/test/controllers/overrides/passwords_controller_test.rb +64 -0
- data/test/controllers/overrides/registrations_controller_test.rb +46 -0
- data/test/controllers/overrides/sessions_controller_test.rb +35 -0
- data/test/controllers/overrides/token_validations_controller_test.rb +43 -0
- data/test/dummy/app/active_record/confirmable_user.rb +11 -0
- data/test/dummy/app/active_record/lockable_user.rb +7 -0
- data/test/dummy/app/active_record/mang.rb +5 -0
- data/test/dummy/app/active_record/only_email_user.rb +7 -0
- data/test/dummy/app/active_record/scoped_user.rb +9 -0
- data/test/dummy/app/active_record/unconfirmable_user.rb +9 -0
- data/test/dummy/app/active_record/unregisterable_user.rb +9 -0
- data/test/dummy/app/active_record/user.rb +6 -0
- data/test/dummy/app/controllers/application_controller.rb +12 -3
- data/test/dummy/app/controllers/auth_origin_controller.rb +7 -0
- data/test/dummy/app/controllers/custom/confirmations_controller.rb +13 -0
- data/test/dummy/app/controllers/custom/omniauth_callbacks_controller.rb +13 -0
- data/test/dummy/app/controllers/custom/passwords_controller.rb +39 -0
- data/test/dummy/app/controllers/custom/registrations_controller.rb +39 -0
- data/test/dummy/app/controllers/custom/sessions_controller.rb +29 -0
- data/test/dummy/app/controllers/custom/token_validations_controller.rb +19 -0
- data/test/dummy/app/controllers/demo_group_controller.rb +15 -0
- data/test/dummy/app/controllers/demo_mang_controller.rb +14 -0
- data/test/dummy/app/controllers/demo_user_controller.rb +27 -0
- data/test/dummy/app/controllers/overrides/confirmations_controller.rb +29 -0
- data/test/dummy/app/controllers/overrides/omniauth_callbacks_controller.rb +16 -0
- data/test/dummy/app/controllers/overrides/passwords_controller.rb +36 -0
- data/test/dummy/app/controllers/overrides/registrations_controller.rb +29 -0
- data/test/dummy/app/controllers/overrides/sessions_controller.rb +36 -0
- data/test/dummy/app/controllers/overrides/token_validations_controller.rb +23 -0
- data/test/dummy/app/helpers/application_helper.rb +1056 -0
- data/test/dummy/app/models/concerns/favorite_color.rb +19 -0
- data/test/dummy/app/mongoid/confirmable_user.rb +52 -0
- data/test/dummy/app/mongoid/lockable_user.rb +38 -0
- data/test/dummy/app/mongoid/mang.rb +46 -0
- data/test/dummy/app/mongoid/only_email_user.rb +33 -0
- data/test/dummy/app/mongoid/scoped_user.rb +50 -0
- data/test/dummy/app/mongoid/unconfirmable_user.rb +44 -0
- data/test/dummy/app/mongoid/unregisterable_user.rb +47 -0
- data/test/dummy/app/mongoid/user.rb +49 -0
- data/test/dummy/app/views/layouts/application.html.erb +0 -2
- data/test/dummy/config/application.rb +25 -8
- data/test/dummy/config/application.yml.bk +0 -0
- data/test/dummy/config/boot.rb +8 -2
- data/test/dummy/config/environment.rb +3 -1
- data/test/dummy/config/environments/development.rb +10 -11
- data/test/dummy/config/environments/production.rb +3 -17
- data/test/dummy/config/environments/test.rb +25 -3
- data/test/dummy/config/initializers/backtrace_silencers.rb +2 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -1
- data/{config → test/dummy/config}/initializers/devise.rb +63 -31
- data/test/dummy/config/initializers/devise_token_auth.rb +55 -0
- data/test/dummy/config/initializers/figaro.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +2 -0
- data/test/dummy/config/initializers/inflections.rb +2 -0
- data/test/dummy/config/initializers/mime_types.rb +2 -0
- data/test/dummy/config/initializers/omniauth.rb +7 -1
- data/test/dummy/config/initializers/session_store.rb +2 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +2 -0
- data/test/dummy/config/routes.rb +55 -1
- data/test/dummy/config/spring.rb +3 -0
- data/test/dummy/config.ru +14 -0
- data/test/dummy/db/migrate/20140715061447_devise_token_auth_create_users.rb +58 -0
- data/test/dummy/db/migrate/20140715061805_devise_token_auth_create_mangs.rb +57 -0
- data/test/dummy/db/migrate/20140829044006_add_operating_thetan_to_user.rb +8 -0
- data/test/dummy/db/migrate/20140916224624_add_favorite_color_to_mangs.rb +7 -0
- data/test/dummy/db/migrate/20141222035835_devise_token_auth_create_only_email_users.rb +55 -0
- data/test/dummy/db/migrate/20141222053502_devise_token_auth_create_unregisterable_users.rb +56 -0
- data/test/dummy/db/migrate/20150708104536_devise_token_auth_create_unconfirmable_users.rb +56 -0
- data/test/dummy/db/migrate/20160103235141_devise_token_auth_create_scoped_users.rb +56 -0
- data/test/dummy/db/migrate/20160629184441_devise_token_auth_create_lockable_users.rb +56 -0
- data/test/dummy/db/migrate/20190924101113_devise_token_auth_create_confirmable_users.rb +49 -0
- data/test/dummy/db/schema.rb +180 -28
- data/test/dummy/lib/migration_database_helper.rb +43 -0
- data/test/dummy/tmp/generators/app/models/user.rb +11 -0
- data/test/dummy/tmp/generators/config/initializers/devise_token_auth.rb +66 -0
- data/{db/migrate/20140628234942_devise_token_auth_create_users.rb → test/dummy/tmp/generators/db/migrate/20240519164408_devise_token_auth_create_users.rb} +16 -23
- data/test/factories/users.rb +41 -0
- data/test/lib/devise_token_auth/blacklist_test.rb +19 -0
- data/test/lib/devise_token_auth/rails/custom_routes_test.rb +30 -0
- data/test/lib/devise_token_auth/rails/routes_test.rb +87 -0
- data/test/lib/devise_token_auth/token_factory_test.rb +191 -0
- data/test/lib/devise_token_auth/url_test.rb +26 -0
- data/test/lib/generators/devise_token_auth/install_generator_test.rb +217 -0
- data/test/lib/generators/devise_token_auth/install_generator_with_namespace_test.rb +222 -0
- data/test/lib/generators/devise_token_auth/install_views_generator_test.rb +25 -0
- data/test/models/concerns/mongoid_support_test.rb +31 -0
- data/test/models/concerns/tokens_serialization_test.rb +104 -0
- data/test/models/confirmable_user_test.rb +35 -0
- data/test/models/only_email_user_test.rb +29 -0
- data/test/models/user_test.rb +251 -0
- data/test/support/controllers/routes.rb +43 -0
- data/test/test_helper.rb +136 -10
- metadata +368 -80
- data/MIT-LICENSE +0 -20
- data/README.rdoc +0 -3
- data/app/assets/javascripts/devise_token_auth/application.js +0 -13
- data/app/assets/stylesheets/devise_token_auth/application.css +0 -15
- data/app/controllers/devise_token_auth/auth_controller.rb +0 -62
- data/app/helpers/devise_token_auth/application_helper.rb +0 -4
- data/app/models/user.rb +0 -6
- data/app/views/devise_token_auth/omniauth_success.html.erb +0 -7
- data/app/views/layouts/omniauth_response.html.erb +0 -20
- data/config/locales/devise.en.yml +0 -59
- data/config/routes.rb +0 -14
- data/lib/generators/devise_token_auth/devise_token_auth_generator.rb +0 -3
- data/test/devise_token_auth_test.rb +0 -7
- data/test/dummy/Rakefile +0 -6
- data/test/dummy/app/assets/javascripts/application.js +0 -13
- data/test/dummy/app/assets/stylesheets/application.css +0 -15
- data/test/dummy/bin/bundle +0 -3
- data/test/dummy/bin/rails +0 -4
- data/test/dummy/bin/rake +0 -4
- data/test/dummy/config/application.yml +0 -13
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/config/initializers/assets.rb +0 -8
- data/test/dummy/config/locales/en.yml +0 -23
- data/test/dummy/config/secrets.yml +0 -22
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20140629011345_devise_token_auth_create_users.devise_token_auth.rb +0 -57
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +0 -3406
- data/test/dummy/public/404.html +0 -67
- data/test/dummy/public/422.html +0 -67
- data/test/dummy/public/500.html +0 -66
- data/test/dummy/public/favicon.ico +0 -0
- data/test/integration/navigation_test.rb +0 -10
- data/test/lib/generators/devise_token_auth/devise_token_auth_generator_test.rb +0 -16
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
module DeviseTokenAuth
|
|
2
|
-
class AuthController < ApplicationController
|
|
3
|
-
respond_to :json
|
|
4
|
-
|
|
5
|
-
def validate_token
|
|
6
|
-
user = User.where(uid: params[:uid], auth_token: params[:auth_token]).first
|
|
7
|
-
|
|
8
|
-
if not user.nil?
|
|
9
|
-
render json: {
|
|
10
|
-
success: true,
|
|
11
|
-
data: user.as_json
|
|
12
|
-
}
|
|
13
|
-
else
|
|
14
|
-
render json: {
|
|
15
|
-
success: false,
|
|
16
|
-
errors: ["Invalid login credentials"]
|
|
17
|
-
}, status: 401
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def omniauth_success
|
|
22
|
-
# find or create user by provider and provider uid
|
|
23
|
-
@user = User.where({
|
|
24
|
-
uid: auth_hash['uid'],
|
|
25
|
-
provider: auth_hash['provider'],
|
|
26
|
-
email: auth_hash['info']['email'],
|
|
27
|
-
}).first_or_initialize
|
|
28
|
-
|
|
29
|
-
# set crazy password for new oauth users. this is only used to prevent
|
|
30
|
-
# access via email sign-in.
|
|
31
|
-
unless @user.id
|
|
32
|
-
p = SecureRandom.urlsafe_base64(nil, false)
|
|
33
|
-
@user.password = p
|
|
34
|
-
@user.password_confirmation = p
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
# sync user info with provider, update/generate auth token
|
|
38
|
-
@user.update_attributes({
|
|
39
|
-
nickname: auth_hash['info']['nickname'],
|
|
40
|
-
name: auth_hash['info']['name'],
|
|
41
|
-
image: auth_hash['info']['image'],
|
|
42
|
-
auth_token: SecureRandom.urlsafe_base64(nil, false)
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
# render user info to javascript postMessage communication window
|
|
46
|
-
respond_to do |format|
|
|
47
|
-
format.html { render :layout => "omniauth_response", :template => "devise_token_auth/omniauth_success" }
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def omniauth_failure
|
|
52
|
-
render json: {
|
|
53
|
-
success: false,
|
|
54
|
-
errors: [params[:message]]
|
|
55
|
-
}, status: 500
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def auth_hash
|
|
59
|
-
request.env['omniauth.auth']
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
end
|
data/app/models/user.rb
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<script>
|
|
5
|
-
window.addEventListener("message", function(ev) {
|
|
6
|
-
if (ev.data === "requestCredentials") {
|
|
7
|
-
ev.source.postMessage({
|
|
8
|
-
<%= yield %>
|
|
9
|
-
}, '*');
|
|
10
|
-
window.close();
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
</script>
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
<pre>
|
|
17
|
-
Redirecting...
|
|
18
|
-
</pre>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
|
|
2
|
-
|
|
3
|
-
en:
|
|
4
|
-
devise:
|
|
5
|
-
confirmations:
|
|
6
|
-
confirmed: "Your account was successfully confirmed."
|
|
7
|
-
send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
|
|
8
|
-
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
|
|
9
|
-
failure:
|
|
10
|
-
already_authenticated: "You are already signed in."
|
|
11
|
-
inactive: "Your account is not activated yet."
|
|
12
|
-
invalid: "Invalid email or password."
|
|
13
|
-
locked: "Your account is locked."
|
|
14
|
-
last_attempt: "You have one more attempt before your account will be locked."
|
|
15
|
-
not_found_in_database: "Invalid email or password."
|
|
16
|
-
timeout: "Your session expired. Please sign in again to continue."
|
|
17
|
-
unauthenticated: "You need to sign in or sign up before continuing."
|
|
18
|
-
unconfirmed: "You have to confirm your account before continuing."
|
|
19
|
-
mailer:
|
|
20
|
-
confirmation_instructions:
|
|
21
|
-
subject: "Confirmation instructions"
|
|
22
|
-
reset_password_instructions:
|
|
23
|
-
subject: "Reset password instructions"
|
|
24
|
-
unlock_instructions:
|
|
25
|
-
subject: "Unlock Instructions"
|
|
26
|
-
omniauth_callbacks:
|
|
27
|
-
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
|
|
28
|
-
success: "Successfully authenticated from %{kind} account."
|
|
29
|
-
passwords:
|
|
30
|
-
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
|
|
31
|
-
send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
|
|
32
|
-
send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
|
|
33
|
-
updated: "Your password was changed successfully. You are now signed in."
|
|
34
|
-
updated_not_active: "Your password was changed successfully."
|
|
35
|
-
registrations:
|
|
36
|
-
destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon."
|
|
37
|
-
signed_up: "Welcome! You have signed up successfully."
|
|
38
|
-
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
|
|
39
|
-
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
|
|
40
|
-
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account."
|
|
41
|
-
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
|
|
42
|
-
updated: "You updated your account successfully."
|
|
43
|
-
sessions:
|
|
44
|
-
signed_in: "Signed in successfully."
|
|
45
|
-
signed_out: "Signed out successfully."
|
|
46
|
-
unlocks:
|
|
47
|
-
send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes."
|
|
48
|
-
send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes."
|
|
49
|
-
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
|
|
50
|
-
errors:
|
|
51
|
-
messages:
|
|
52
|
-
already_confirmed: "was already confirmed, please try signing in"
|
|
53
|
-
confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
|
|
54
|
-
expired: "has expired, please request a new one"
|
|
55
|
-
not_found: "not found"
|
|
56
|
-
not_locked: "was not locked"
|
|
57
|
-
not_saved:
|
|
58
|
-
one: "1 error prohibited this %{resource} from being saved:"
|
|
59
|
-
other: "%{count} errors prohibited this %{resource} from being saved:"
|
data/config/routes.rb
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
DeviseTokenAuth::Engine.routes.draw do
|
|
2
|
-
devise_for :users,
|
|
3
|
-
:class_name => "User",
|
|
4
|
-
:module => :devise,
|
|
5
|
-
:path => "",
|
|
6
|
-
:controllers => {:sessions => "devise_token_auth/sessions",
|
|
7
|
-
:registrations => "devise_token_auth/registrations",
|
|
8
|
-
:passwords => "devise_token_auth/passwords",
|
|
9
|
-
:confirmations => "devise_token_auth/confirmations"}
|
|
10
|
-
|
|
11
|
-
post "validate_token", to: "auth#validate_token"
|
|
12
|
-
get "failure", to: "auth#omniauth_failure"
|
|
13
|
-
get ":provider/callback", to: "auth#omniauth_success"
|
|
14
|
-
end
|
data/test/dummy/Rakefile
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
|
2
|
-
// listed below.
|
|
3
|
-
//
|
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
|
5
|
-
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
|
6
|
-
//
|
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
|
8
|
-
// compiled file.
|
|
9
|
-
//
|
|
10
|
-
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
|
11
|
-
// about supported directives.
|
|
12
|
-
//
|
|
13
|
-
//= require_tree .
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
|
3
|
-
* listed below.
|
|
4
|
-
*
|
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
|
6
|
-
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
|
7
|
-
*
|
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any styles
|
|
10
|
-
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
|
11
|
-
* file per style scope.
|
|
12
|
-
*
|
|
13
|
-
*= require_tree .
|
|
14
|
-
*= require_self
|
|
15
|
-
*/
|
data/test/dummy/bin/bundle
DELETED
data/test/dummy/bin/rails
DELETED
data/test/dummy/bin/rake
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Add application configuration variables here, as shown below.
|
|
2
|
-
|
|
3
|
-
GITHUB_KEY: ebc065d5c6b6d5f1fc7e
|
|
4
|
-
GITHUB_SECRET: 0087577ed1fbb538ac97dcb4b0df9b582b148b7b
|
|
5
|
-
GITHUB_REDIRECT_URI: http://localhost:3000/auth/github/callback
|
|
6
|
-
|
|
7
|
-
FACEBOOK_KEY: 515818101878894
|
|
8
|
-
FACEBOOK_SECRET: d7cfef7cfa485dd30f10c237a97a0a8d
|
|
9
|
-
FACEBOOK_REDIRECT_URI: http://localhost:3000/auth/facebook/callback
|
|
10
|
-
|
|
11
|
-
GOOGLE_KEY: 276861244411-f90i61dv3gvdmjrscm5u3mok757bfhkt.apps.googleusercontent.com
|
|
12
|
-
GOOGLE_SECRET: UV0sqR9M0LfDhrPuvS1vyPB_
|
|
13
|
-
GOOGLE_REDIRECT_URI: http://localhost:3000/auth/google/callback
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# SQLite version 3.x
|
|
2
|
-
# gem install sqlite3
|
|
3
|
-
#
|
|
4
|
-
# Ensure the SQLite 3 gem is defined in your Gemfile
|
|
5
|
-
# gem 'sqlite3'
|
|
6
|
-
#
|
|
7
|
-
default: &default
|
|
8
|
-
adapter: sqlite3
|
|
9
|
-
pool: 5
|
|
10
|
-
timeout: 5000
|
|
11
|
-
|
|
12
|
-
development:
|
|
13
|
-
<<: *default
|
|
14
|
-
database: db/development.sqlite3
|
|
15
|
-
|
|
16
|
-
# Warning: The database defined as "test" will be erased and
|
|
17
|
-
# re-generated from your development database when you run "rake".
|
|
18
|
-
# Do not set this db to the same as development or production.
|
|
19
|
-
test:
|
|
20
|
-
<<: *default
|
|
21
|
-
database: db/test.sqlite3
|
|
22
|
-
|
|
23
|
-
production:
|
|
24
|
-
<<: *default
|
|
25
|
-
database: db/production.sqlite3
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
|
2
|
-
|
|
3
|
-
# Version of your assets, change this if you want to expire all your assets.
|
|
4
|
-
Rails.application.config.assets.version = '1.0'
|
|
5
|
-
|
|
6
|
-
# Precompile additional assets.
|
|
7
|
-
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
|
8
|
-
# Rails.application.config.assets.precompile += %w( search.js )
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Files in the config/locales directory are used for internationalization
|
|
2
|
-
# and are automatically loaded by Rails. If you want to use locales other
|
|
3
|
-
# than English, add the necessary files in this directory.
|
|
4
|
-
#
|
|
5
|
-
# To use the locales, use `I18n.t`:
|
|
6
|
-
#
|
|
7
|
-
# I18n.t 'hello'
|
|
8
|
-
#
|
|
9
|
-
# In views, this is aliased to just `t`:
|
|
10
|
-
#
|
|
11
|
-
# <%= t('hello') %>
|
|
12
|
-
#
|
|
13
|
-
# To use a different locale, set it with `I18n.locale`:
|
|
14
|
-
#
|
|
15
|
-
# I18n.locale = :es
|
|
16
|
-
#
|
|
17
|
-
# This would use the information in config/locales/es.yml.
|
|
18
|
-
#
|
|
19
|
-
# To learn more, please read the Rails Internationalization guide
|
|
20
|
-
# available at http://guides.rubyonrails.org/i18n.html.
|
|
21
|
-
|
|
22
|
-
en:
|
|
23
|
-
hello: "Hello world"
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
|
2
|
-
|
|
3
|
-
# Your secret key is used for verifying the integrity of signed cookies.
|
|
4
|
-
# If you change this key, all old signed cookies will become invalid!
|
|
5
|
-
|
|
6
|
-
# Make sure the secret is at least 30 characters and all random,
|
|
7
|
-
# no regular words or you'll be exposed to dictionary attacks.
|
|
8
|
-
# You can use `rake secret` to generate a secure secret key.
|
|
9
|
-
|
|
10
|
-
# Make sure the secrets in this file are kept private
|
|
11
|
-
# if you're sharing your code publicly.
|
|
12
|
-
|
|
13
|
-
development:
|
|
14
|
-
secret_key_base: 0bf8734819590884c2187d13a26dbda06f965098cf51c8fbdae0281364610b14dc8f487eeb5fd1410ccddc7de0b56e4a535f57a27a487606d1af8965cffd2fa5
|
|
15
|
-
|
|
16
|
-
test:
|
|
17
|
-
secret_key_base: 1e35bf6c80d7987805e9cdfd6957271312a3fe583d5cf8e51dc051b92f74eb7d299dbeba25e4f5d13cdc44d70922b9620d037800ddfaad05d72870b09be04c1f
|
|
18
|
-
|
|
19
|
-
# Do not keep production secrets in the repository,
|
|
20
|
-
# instead read values from the environment.
|
|
21
|
-
production:
|
|
22
|
-
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
|
Binary file
|
data/test/dummy/db/migrate/20140629011345_devise_token_auth_create_users.devise_token_auth.rb
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# This migration comes from devise_token_auth (originally 20140628234942)
|
|
2
|
-
class DeviseTokenAuthCreateUsers < ActiveRecord::Migration
|
|
3
|
-
def change
|
|
4
|
-
create_table(:users) do |t|
|
|
5
|
-
## Database authenticatable
|
|
6
|
-
t.string :email
|
|
7
|
-
t.string :encrypted_password, :null => false, :default => ""
|
|
8
|
-
|
|
9
|
-
## Recoverable
|
|
10
|
-
t.string :reset_password_token
|
|
11
|
-
t.datetime :reset_password_sent_at
|
|
12
|
-
|
|
13
|
-
## Rememberable
|
|
14
|
-
t.datetime :remember_created_at
|
|
15
|
-
|
|
16
|
-
## Trackable
|
|
17
|
-
t.integer :sign_in_count, :default => 0, :null => false
|
|
18
|
-
t.datetime :current_sign_in_at
|
|
19
|
-
t.datetime :last_sign_in_at
|
|
20
|
-
t.string :current_sign_in_ip
|
|
21
|
-
t.string :last_sign_in_ip
|
|
22
|
-
|
|
23
|
-
## Confirmable
|
|
24
|
-
t.string :confirmation_token
|
|
25
|
-
t.datetime :confirmed_at
|
|
26
|
-
t.datetime :confirmation_sent_at
|
|
27
|
-
t.string :confirm_success_url
|
|
28
|
-
# t.string :unconfirmed_email # Only if using reconfirmable
|
|
29
|
-
|
|
30
|
-
## Lockable
|
|
31
|
-
# t.integer :failed_attempts, :default => 0, :null => false # Only if lock strategy is :failed_attempts
|
|
32
|
-
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
|
33
|
-
# t.datetime :locked_at
|
|
34
|
-
|
|
35
|
-
## Token auth
|
|
36
|
-
t.string :auth_token, :default => "", :null => false
|
|
37
|
-
|
|
38
|
-
## User Info
|
|
39
|
-
t.string :name
|
|
40
|
-
t.string :nickname
|
|
41
|
-
t.string :image
|
|
42
|
-
|
|
43
|
-
## unique oauth id
|
|
44
|
-
t.string :provider
|
|
45
|
-
t.string :uid, :null => false, :default => ""
|
|
46
|
-
|
|
47
|
-
t.timestamps
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
add_index :users, :auth_token
|
|
51
|
-
add_index :users, :uid, :unique => true
|
|
52
|
-
add_index :users, :email, :unique => true
|
|
53
|
-
add_index :users, :reset_password_token, :unique => true
|
|
54
|
-
# add_index :users, :confirmation_token, :unique => true
|
|
55
|
-
# add_index :users, :unlock_token, :unique => true
|
|
56
|
-
end
|
|
57
|
-
end
|
data/test/dummy/db/test.sqlite3
DELETED
|
File without changes
|