authentifyd 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +15 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +26 -0
  4. data/Rakefile +34 -0
  5. data/app/assets/images/authentifyd/en.png +0 -0
  6. data/app/assets/images/authentifyd/facebook-logo.png +0 -0
  7. data/app/assets/images/authentifyd/fr.png +0 -0
  8. data/app/assets/images/authentifyd/google-logo.png +0 -0
  9. data/app/assets/images/authentifyd/signin_with_facebook.png +0 -0
  10. data/app/assets/images/authentifyd/signin_with_fb.png +0 -0
  11. data/app/assets/images/authentifyd/signin_with_google.png +0 -0
  12. data/app/assets/images/authentifyd/signin_with_twitter.png +0 -0
  13. data/app/assets/images/authentifyd/twitter-logo.png +0 -0
  14. data/app/assets/javascripts/authentifyd/application.js +15 -0
  15. data/app/assets/stylesheets/authentifyd/application.css +13 -0
  16. data/app/controllers/authentifyd/application_controller.rb +11 -0
  17. data/app/controllers/authentifyd/authentications_controller.rb +94 -0
  18. data/app/controllers/authentifyd/confirmations_controller.rb +5 -0
  19. data/app/controllers/authentifyd/passwords_controller.rb +4 -0
  20. data/app/controllers/authentifyd/registrations_controller.rb +42 -0
  21. data/app/controllers/authentifyd/sessions_controller.rb +13 -0
  22. data/app/controllers/authentifyd/unlocks_controller.rb +4 -0
  23. data/app/helpers/authentifyd/application_helper.rb +4 -0
  24. data/app/models/authentifyd.rb +5 -0
  25. data/app/models/authentifyd/authentication.rb +16 -0
  26. data/app/models/authentifyd/user.rb +66 -0
  27. data/app/views/authentifyd/authentications/_authentication.html.erb +15 -0
  28. data/app/views/authentifyd/authentications/index.html.erb +14 -0
  29. data/app/views/authentifyd/authentications/link.html.erb +14 -0
  30. data/app/views/authentifyd/confirmations/new.html.erb +25 -0
  31. data/app/views/authentifyd/devise/mailer/confirmation_instructions.html.erb +5 -0
  32. data/app/views/authentifyd/devise/mailer/reset_password_instructions.html.erb +8 -0
  33. data/app/views/authentifyd/devise/mailer/unlock_instructions.html.erb +7 -0
  34. data/app/views/authentifyd/devise/shared/_links.erb +30 -0
  35. data/app/views/authentifyd/layouts/_account_menu.html.haml +24 -0
  36. data/app/views/authentifyd/passwords/edit.html.erb +30 -0
  37. data/app/views/authentifyd/passwords/new.html.erb +27 -0
  38. data/app/views/authentifyd/registrations/_authentifyd_form.html.erb +52 -0
  39. data/app/views/authentifyd/registrations/edit.html.erb +1 -0
  40. data/app/views/authentifyd/registrations/new.html.erb +44 -0
  41. data/app/views/authentifyd/sessions/_social_networks.html.erb +23 -0
  42. data/app/views/authentifyd/sessions/new.html.erb +49 -0
  43. data/app/views/authentifyd/unlocks/new.html.erb +28 -0
  44. data/app/views/layouts/authentifyd/_navbar.html.haml +41 -0
  45. data/app/views/layouts/authentifyd/application.html.erb +19 -0
  46. data/config/initializers/devise.rb +3 -0
  47. data/config/initializers/omniauth.rb +119 -0
  48. data/config/locales/devise.en.yml +100 -0
  49. data/config/locales/devise.fr.yml +113 -0
  50. data/config/locales/en.yml +7 -0
  51. data/config/locales/fr.yml +7 -0
  52. data/config/routes.rb +30 -0
  53. data/db/migrate/20121120091659_create_authentifyd_users.rb +52 -0
  54. data/db/migrate/20121120091700_create_authentifyd_authentications.rb +11 -0
  55. data/db/migrate/20130827085250_add_language_to_user.rb +5 -0
  56. data/lib/authentifyd.rb +39 -0
  57. data/lib/authentifyd/engine.rb +16 -0
  58. data/lib/authentifyd/version.rb +3 -0
  59. data/lib/tasks/authentifyd_tasks.rake +4 -0
  60. metadata +256 -0
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Authentifyd</title>
5
+ <%= stylesheet_link_tag "authentifyd/application", :media => "all" %>
6
+ <%= javascript_include_tag "authentifyd/application" %>
7
+ <%= csrf_meta_tags %>
8
+ <%= Authentifyd.custom_head_snippet.try(:call).try(:html_safe) %>
9
+ </head>
10
+ <body class=<%= defined?(@body_class) ? @body_class : nil %>>
11
+
12
+ <%= render partial: "/layouts/authentifyd/navbar" %>
13
+
14
+ <%= yield %>
15
+
16
+ <%= Authentifyd.custom_bottom_snippet.try(:call).try(:html_safe) %>
17
+
18
+ </body>
19
+ </html>
@@ -0,0 +1,3 @@
1
+ Devise.setup do |config|
2
+ config.router_name = :authentifyd
3
+ end
@@ -0,0 +1,119 @@
1
+ # load facebook credentials
2
+ facebook_config = Rails.root.to_s + "/config/services/facebook.yml.erb"
3
+ if File.exist?(facebook_config)
4
+ facebook_apps = File.read(facebook_config)
5
+ FACEBOOK = YAML.load(ERB.new(facebook_apps).result)[Rails.env].symbolize_keys
6
+ end
7
+
8
+ twitter_config = Rails.root.to_s + "/config/services/twitter.yml.erb"
9
+ if File.exist?(twitter_config)
10
+ twitter_apps = File.read(twitter_config)
11
+ TWITTER = YAML.load(ERB.new(twitter_apps).result)[Rails.env].symbolize_keys
12
+ end
13
+
14
+ google_config = Rails.root.to_s + "/config/services/google.yml.erb"
15
+ if File.exist?(google_config)
16
+ google_apps = File.read(google_config)
17
+ GOOGLE = YAML.load(ERB.new(google_apps).result)[Rails.env].symbolize_keys
18
+ end
19
+
20
+ Rails.application.config.middleware.use OmniAuth::Builder do
21
+ if defined?(TWITTER)
22
+ provider :twitter, TWITTER[:app_id], TWITTER[:app_secret],
23
+ :callback_path => Authentifyd.embeddable_callback_path("/auth/twitter/callback")
24
+ end
25
+ if defined?(GOOGLE)
26
+ provider :google_oauth2, GOOGLE[:app_id], GOOGLE[:app_secret],
27
+ :callback_path => Authentifyd.embeddable_callback_path("/auth/google_oauth2/callback"),
28
+ :scope => "userinfo.email,userinfo.profile,plus.me"
29
+ end
30
+ if defined?(FACEBOOK)
31
+ provider :facebook, FACEBOOK[:app_id], FACEBOOK[:app_secret],
32
+ :callback_path => Authentifyd.embeddable_callback_path("/auth/facebook/callback"),
33
+ :scope => "user_about_me,email"
34
+ # ( %w(email) +
35
+ #(Authentifyd.omniauth_config.try(:[], :facebook).try(:[], :scope) || [])
36
+ # ).join(',')
37
+ #
38
+ # #
39
+ # # User and Friends Permissions
40
+ # # ############################
41
+ # #
42
+ # # all following permissions can be asked for friends too
43
+ # "user_about_me",
44
+ # # friends_about_me,
45
+ # "user_activities",
46
+ # # friends_activities,
47
+ # "user_birthday",
48
+ # # friends_birthday,
49
+ # # user_checkins,
50
+ # # friends_checkins,
51
+ # # user_education_history,
52
+ # # friends_education_history
53
+ # "user_events",
54
+ # # friends_events,
55
+ # "user_groups",
56
+ # # friends_groups,
57
+ # "user_hometown",
58
+ # # friends_hometown,
59
+ # "user_interests",
60
+ # # friends_interests
61
+ # "user_likes",
62
+ # "friends_likes",
63
+ # "user_location",
64
+ # "friends_location",
65
+ # # user_notes,
66
+ # # friends_notes,
67
+ # # user_photos,
68
+ # # friends_photos,
69
+ # # user_questions,
70
+ # # friends_questions,
71
+ # "user_relationships",
72
+ # "friends_relationships",
73
+ # "user_relationship_details",
74
+ # "friends_relationship_details",
75
+ # "user_religion_politics",
76
+ # "friends_religion_politics",
77
+ # "user_status",
78
+ # "friends_status",
79
+ # "user_videos",
80
+ # "friends_videos",
81
+ # "user_website",
82
+ # "friends_website",
83
+ # "user_work_history",
84
+ # "friends_work_history",
85
+ # "email",
86
+ # #
87
+ # # Extended Permissions # optional for sign up - user can sign up while saying no
88
+ # # ####################
89
+ # #
90
+ # "read_friendlists",
91
+ # # read_insights,
92
+ # # "read_mailbox",
93
+ # # "read_requests",
94
+ # # "read_stream",
95
+ # # "xmpp_login",
96
+ # # ads_management,
97
+ # # "create_event",
98
+ # # "manage_friendlists",
99
+ # # "manage_notifications",
100
+ # "user_online_presence",
101
+ # "friends_online_presence",
102
+ # # "publish_checkins",
103
+ # "publish_stream",
104
+ # # "rsvp_event",
105
+ # #
106
+ # # OpenGraph Permissions # mandatory for sign up - user can't sign up while saying no
107
+ # # #####################
108
+ # "publish_actions",
109
+ # "user_actions.music",
110
+ # "friends_actions.music",
111
+ # # user_actions.news,
112
+ # # friends_actions.news,
113
+ # "user_actions.video",
114
+ # "friends_actions.video",
115
+ #
116
+ # # offline_access,
117
+ # ]
118
+ end
119
+ end
@@ -0,0 +1,100 @@
1
+ en:
2
+ Unlink_account: "Unlink accounts"
3
+ Existing_linked_accounts: "Existing linked accounts"
4
+ You_have_not_linked_any_account_yet: "You have not linked any account yet"
5
+ Link_other_accounts: "Link your other accounts"
6
+
7
+ This_email_is_already_taken_Sign_in_to_link_these_accounts: "This email is already taken - Sign in to link these accounts!"
8
+
9
+ Welcome: 'Welcome'
10
+ You_can_confirm_your_account_email_through_the_link_below: "You can confirm your account email through the link below:"
11
+ Confirm_my_account: "Confirm my account"
12
+
13
+ Hello: 'Hello'
14
+ Someone_has_requested_a_link_to_change_your_password_and_you_can_do_this_through_the_link_below: "Someone has requested a link to change your password, and you can do this through the link below."
15
+ Change_my_password: "Change my password"
16
+ If_you_didnt_request_this_please_ignore_this_email: "If you didn't request this, please ignore this email."
17
+ Your_password_wont_change_until_you_access_the_link_above_and_create_a_new_one: "Your password won't change until you access the link above and create a new one."
18
+
19
+ Your_account_has_been_locked_due_to_an_excessive_amount_of_unsuccessful_sign_in_attempts: "Your account has been locked due to an excessive amount of unsuccessful sign in attempts."
20
+ Click_the_link_below_to_unlock_your_account: "Click the link below to unlock your account:"
21
+ Unlock_my_account: "Unlock my account"
22
+
23
+ Forgot_your_password: "Forgot your password?"
24
+ Didnt_receive_confirmation_instructions: "Didn't receive confirmation instructions?"
25
+ Didnt_receive_unlock_instructions: "Didn't receive unlock instructions?"
26
+ Sign_in_with: "Sign in with"
27
+
28
+ Sign_in_with_your_email: "Sign in with your email"
29
+ Email: "Email"
30
+ Password: "Password"
31
+ Remember_me: "Remember me"
32
+ or_use_your_prefered_profile: "Or use you prefered profile"
33
+
34
+ Resend_confirmation_instructions: "Send a new confirmation email"
35
+
36
+ Change_your_password: "Change your password"
37
+
38
+ Send_me_reset_password_instructions: "Send me a mail to reset my password"
39
+ Send: "Send"
40
+
41
+ Resend_unlock_instructions: "Send me an email with unlock instructions"
42
+
43
+ Edit_account: "Edit my account"
44
+ Password_confirmation: "Password confirmation"
45
+ leave_blank_if_you_dont_want_to_change_it: "Leave blank if you don't want to change your password"
46
+ Current_password: "Current password"
47
+ we_need_your_current_password_to_confirm_your_changes: "We need to verify your current password before modifying it"
48
+ Update: "Update"
49
+ Cancel_my_account: "Destroy my account"
50
+ Are_you_sure: "Are you sure?"
51
+ Back: "Back"
52
+
53
+ Sign_up_with_your_email: "Sign up with your email"
54
+ Sign_up: "Sign up"
55
+
56
+ errors:
57
+ messages:
58
+ not_found: "not found"
59
+ already_confirmed: "was already confirmed"
60
+ not_locked: "was not locked"
61
+ not_saved:
62
+ one: "1 error prohibited this %{resource} from being saved:"
63
+ other: "%{count} errors prohibited this %{resource} from being saved:"
64
+
65
+ devise:
66
+ failure:
67
+ unauthenticated: 'You need to sign in or sign up before continuing.'
68
+ unconfirmed: 'You have to confirm your account before continuing.'
69
+ locked: 'Your account is locked.'
70
+ invalid: 'Invalid email or password.'
71
+ invalid_token: 'Invalid authentication token.'
72
+ timeout: 'Your session expired, please sign in again to continue.'
73
+ inactive: 'Your account was not activated yet.'
74
+ sessions:
75
+ signed_in: 'Signed in successfully.'
76
+ signed_out: 'Signed out successfully.'
77
+ passwords:
78
+ send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
79
+ updated: 'Your password was changed successfully. You are now signed in.'
80
+ confirmations:
81
+ send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
82
+ confirmed: 'Your account was successfully confirmed. You are now signed in.'
83
+ registrations:
84
+ signed_up: 'Welcome! You have signed up successfully.'
85
+ inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.'
86
+ updated: 'You updated your account successfully.'
87
+ destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
88
+ unlocks:
89
+ send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
90
+ unlocked: 'Your account was successfully unlocked. You are now signed in.'
91
+ oauth_callbacks:
92
+ success: 'Successfully authorized from %{kind} account.'
93
+ failure: 'Could not authorize you from %{kind} because "%{reason}".'
94
+ mailer:
95
+ confirmation_instructions:
96
+ subject: 'Confirmation instructions'
97
+ reset_password_instructions:
98
+ subject: 'Reset password instructions'
99
+ unlock_instructions:
100
+ subject: 'Unlock Instructions'
@@ -0,0 +1,113 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ fr:
4
+ Unlink_account: "Déconnecter ce compte"
5
+ Existing_linked_accounts: "Comptes liés"
6
+ You_have_not_linked_any_account_yet: "Vous n'avez lié aucun compte pour le moment"
7
+ Link_other_accounts: "Liez vos autres comptes"
8
+
9
+ This_email_is_already_taken_Sign_in_to_link_these_accounts: "Cet email est déjà enregistré - Connectez vous pour lier ces comptes!"
10
+
11
+ Welcome: 'Bienvenue'
12
+ You_can_confirm_your_account_email_through_the_link_below: "Vous pouvez confirmer votre compte en cliquant le lien ci-dessous:"
13
+ Confirm_my_account: "Confirmer mon compte"
14
+
15
+ Hello: 'Bonjour'
16
+ Someone_has_requested_a_link_to_change_your_password_and_you_can_do_this_through_the_link_below: "Un lien a été demandé pour modifier votre mot de passe. Vous pouvez faire cela en cliquant sur le lien ci-dessous:"
17
+ Change_my_password: "Modifier mon mot de passe"
18
+ If_you_didnt_request_this_please_ignore_this_email: "Si vous n'avez pas demandé cet email, nous vous prions de ne pas tenir compte de cet email."
19
+ Your_password_wont_change_until_you_access_the_link_above_and_create_a_new_one: "Votre mot de passe ne changera pas tant que vous ne cliquerez pas sur ce lien pour en créer un nouveau."
20
+
21
+ Your_account_has_been_locked_due_to_an_excessive_amount_of_unsuccessful_sign_in_attempts: "Votre compte a été bloqué à cause d'un nombre excessif de tentaties de connexion infructueuses."
22
+ Click_the_link_below_to_unlock_your_account: "Cliquez le lien ci-dessous pour débloquer votre compte:"
23
+ Unlock_my_account: "Débloquer mon compte"
24
+
25
+ Forgot_your_password: "Mot de passe oublié?"
26
+ Didnt_receive_confirmation_instructions: "Vous n'avez pas reçu le mail de confirmation?"
27
+ Didnt_receive_unlock_instructions: "Vous n'avez pas reçu le mail pour débloquer votre compte?"
28
+ Sign_in_with: "Connectez-vous avec"
29
+
30
+ Sign_in_with_your_email: "Connectez-vous avec votre email"
31
+ Email: "Email"
32
+ Password: "Mot de passe"
33
+ Remember_me: "Se souvenir de moi"
34
+ or_use_your_prefered_profile: "Ou utilisez votre profil préféré"
35
+
36
+ Resend_confirmation_instructions: "Recevoir un nouvel email de confirmation"
37
+
38
+ Change_your_password: "Modifier mon mot de passe"
39
+
40
+ Send_me_reset_password_instructions: "Recevoir un email pour modifier mon mot de passe"
41
+ Send: "Envoyer"
42
+
43
+ Resend_unlock_instructions: "Recevoir un email pour débloquer mon compte"
44
+
45
+ Edit_account: "Modifier mon compte"
46
+ Password_confirmation: "Confirmation du mot de passe"
47
+ leave_blank_if_you_dont_want_to_change_it: "Laisser vide si vous ne souhaitez pas changer le mot de passe"
48
+ Current_password: "Mot de passe actuel"
49
+ we_need_your_current_password_to_confirm_your_changes: "Nous devons vérifier votre mot de passe actuel pour pouvoir le modifier"
50
+ Update: "Mettre à jour"
51
+ Cancel_my_account: "Détruire mon compte"
52
+ Are_you_sure: "Etes-vous sûr(e) ?"
53
+ Back: "Retour"
54
+
55
+ Sign_up_with_your_email: "Inscrivez-vous avec votre email"
56
+ Sign_up: "M'inscrire"
57
+
58
+ devise:
59
+ confirmations:
60
+ confirmed: 'Votre compte a été validé, vous êtes maintenant connecté'
61
+ send_instructions: 'Vous allez recevoir les instructions nécessaires à la confirmation de votre compte dans quelques minutes'
62
+ send_paranoid_instructions: 'Si votre e-mail existe dans notre base de données, vous allez bientôt recevoir un e-mail contenant les instructions de confirmation de votre compte.'
63
+ failure:
64
+ already_authenticated: "Vous êtes déjà connecté !"
65
+ inactive: "Votre compte n'est pas encore activé."
66
+ invalid: "Email ou mot de passe incorrect."
67
+ invalid_token: "Jeton d'authentification incorrect."
68
+ locked: "Votre compte est verrouillé."
69
+ not_found_in_database: "Email ou mot de passe invalide."
70
+ timeout: "Votre session est expirée, veuillez vous reconnecter pour continuer."
71
+ unauthenticated: "Vous devez vous connecter ou vous inscrire pour continuer."
72
+ unconfirmed: "Vous devez valider votre compte pour continuer."
73
+ mailer:
74
+ confirmation_instructions:
75
+ subject: "Instructions de confirmation"
76
+ reset_password_instructions:
77
+ subject: "Instructions pour changer le mot de passe"
78
+ unlock_instructions:
79
+ subject: "Instructions pour déverrouiller le compte"
80
+ omniauth_callbacks:
81
+ failure: "Nous n'avons pas pu vous authentifier via %{kind} : '%{reason}'."
82
+ success: 'Authentifié avec succès via %{kind}.'
83
+ passwords:
84
+ no_token: "Vous ne pouvez accéder à cette page sans passer par un e-mail de réinitialisation de mot de passe. Si vous êtes passé par un e-mail de ce type, assurez-vous d'utiliser l'URL complète."
85
+ send_instructions: 'Vous allez recevoir les instructions de réinitialisation du mot de passe dans quelques instants'
86
+ send_paranoid_instructions: "Si votre e-mail existe dans notre base de données, vous allez recevoir un lien de réinitialisation par e-mail"
87
+ updated: 'Votre mot de passe a été édité avec succès, vous êtes maintenant connecté'
88
+ updated_not_active: 'Votre mot de passe a été changé avec succès.'
89
+ registrations:
90
+ destroyed: 'Votre compte a été supprimé avec succès. Nous espérons vous revoir bientôt.'
91
+ signed_up: 'Bienvenu, vous êtes connecté'
92
+ signed_up_but_inactive: "Vous êtes bien enregistré. Vous ne pouvez cependant pas vous connecter car votre compte n'est pas encore activé."
93
+ signed_up_but_locked: "Vous êtes bien enregistré. Vous ne pouvez cependant pas vous connecter car votre compte est verrouillé."
94
+ signed_up_but_unconfirmed: 'Un message contenant un lien de confirmation a été envoyé à votre adresse email. Ouvrez ce lien pour activer votre compte.'
95
+ update_needs_confirmation: "Votre compte a bien été mis à jour mais nous devons vérifier votre nouvelle adresse email. Merci de vérifier vos emails et de cliquer sur le lien de confirmation pour finaliser la validation de votre nouvelle adresse."
96
+ updated: 'Votre compte a été modifié avec succès.'
97
+ sessions:
98
+ signed_in: "Connecté."
99
+ signed_out: "Déconnecté."
100
+ unlocks:
101
+ send_instructions: 'Vous allez recevoir les instructions nécessaires au déverrouillage de votre compte dans quelques instants'
102
+ send_paranoid_instructions: 'Si votre compte existe, vous allez bientôt recevoir un email contenant les instructions pour le déverrouiller.'
103
+ unlocked: 'Votre compte a été déverrouillé avec succès, vous êtes maintenant connecté.'
104
+ errors:
105
+ messages:
106
+ already_confirmed: "a déjà été validé(e)"
107
+ confirmation_period_expired: "à confirmer dans les %{period}, merci de faire une nouvelle demande"
108
+ expired: "a expiré, merci d'en faire une nouvelle demande"
109
+ not_found: "n'a pas été trouvé(e)"
110
+ not_locked: "n'était pas verrouillé(e)"
111
+ not_saved:
112
+ one: "1 erreur a empêché ce(tte) %{resource} d'être sauvegardé(e) :"
113
+ other: "%{count} erreurs ont empêché ce(tte) %{resource} d'être sauvegardé(e) :"
@@ -0,0 +1,7 @@
1
+ en:
2
+ Are_you_sure?: "Are you sure?"
3
+ Already_a_member: "Are you already a member ?"
4
+ Not_already_a_member: "If you do not already have an account, create one!"
5
+ Sign_up: "Create an account"
6
+ Sign_in: "Log in"
7
+ Linked_accounts: "Linked accounts"
@@ -0,0 +1,7 @@
1
+ fr:
2
+ Are_you_sure?: "Êtes-vous sûr(e)?"
3
+ Already_a_member: "Vous êtes déjà inscrit ?"
4
+ Not_already_a_member: "Vous n'êtes pas encore inscrit ?"
5
+ Sign_up: "Créez un compte"
6
+ Sign_in: "Connectez-vous"
7
+ Linked_accounts: "Comptes liés"
@@ -0,0 +1,30 @@
1
+ Authentifyd::Engine.routes.draw do
2
+ devise_for :users, {
3
+ class_name: 'Authentifyd::User',
4
+ module: :devise,
5
+ controllers: { registrations: Authentifyd.devise_config[:registrations_controller],
6
+ sessions: Authentifyd.devise_config[:sessions_controller],
7
+ confirmations: Authentifyd.devise_config[:confirmations_controller],
8
+ passwords: Authentifyd.devise_config[:passwords_controller],
9
+ unlocks: Authentifyd.devise_config[:unlocks_controller]
10
+ }
11
+ }
12
+
13
+ match "authentications/:user_id/link", :controller => 'authentications', :action => "link", :as => :link_accounts
14
+ match "authentications/:user_id/add", :controller => 'authentications', :action => "add", :as => :add_account
15
+
16
+ get "authentications", :controller => 'authentications', :action => "index", :as => :accounts
17
+ delete "authentications/:id", controller: 'authentications', action: "destroy", as: :destroy_account
18
+
19
+ root :to => "authentications#index"
20
+ #root :to => redirect("/")
21
+ end
22
+
23
+ # prefix_on_default_locale => /:controller will not respond to request, only /:locale/:controller will
24
+ # => that is why we need to ad a block below with the redirect mechanism for all requests without :locale
25
+ Localyzed.localyze_routes('config/locales/authentifyd/routes.yml', { :prefix_on_default_locale => true, :custom_route_set => Authentifyd::Engine.routes, :keep_untranslated_routes => true }) #, :uniq_translated_root => true})
26
+
27
+ Authentifyd::Engine.routes.draw do
28
+ match "auth/:provider/callback", :controller => 'authentications', :action => "create"
29
+ match "auth/failure", :controller => 'authentications', :action => "failure"
30
+ end
@@ -0,0 +1,52 @@
1
+ class CreateAuthentifydUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table(:authentifyd_users) do |t|
4
+ ## Database authenticatable
5
+ t.string :email, :null => false, :default => ""
6
+ t.string :encrypted_password, :null => false, :default => ""
7
+
8
+ ## Recoverable
9
+ t.string :reset_password_token
10
+ t.datetime :reset_password_sent_at
11
+
12
+ ## Rememberable
13
+ t.datetime :remember_created_at
14
+
15
+ ## Trackable
16
+ t.integer :sign_in_count, :default => 0
17
+ t.datetime :current_sign_in_at
18
+ t.datetime :last_sign_in_at
19
+ t.string :current_sign_in_ip
20
+ t.string :last_sign_in_ip
21
+
22
+ ## Encryptable
23
+ t.string :password_salt
24
+
25
+ ## Confirmable
26
+ t.string :confirmation_token
27
+ t.datetime :confirmed_at
28
+ t.datetime :confirmation_sent_at
29
+ t.string :unconfirmed_email # Only if using reconfirmable
30
+
31
+ ## Lockable
32
+ t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
33
+ t.string :unlock_token # Only if unlock strategy is :email or :both
34
+ t.datetime :locked_at
35
+
36
+ # Token authenticatable
37
+ t.string :authentication_token
38
+
39
+ # custom
40
+ t.boolean :admin, :default => false
41
+
42
+ t.timestamps
43
+ end
44
+
45
+ add_index :authentifyd_users, :email, :unique => true
46
+ add_index :authentifyd_users, :reset_password_token, :unique => true
47
+ add_index :authentifyd_users, :confirmation_token, :unique => true
48
+ add_index :authentifyd_users, :unlock_token, :unique => true
49
+ add_index :authentifyd_users, :authentication_token, :unique => true
50
+ end
51
+
52
+ end