diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-06-25 12:30:31 -0400 | 
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-06-25 12:30:31 -0400 | 
| commit | 7e2e42379cb40a500eb8a236c05788eb3e84d141 (patch) | |
| tree | 784dfe04f81b034889b96b5c251923da7e6f3a1e /app/controllers/users | |
| parent | 275218aeaf24d4f9d58589cf68ec6647f0a65050 (diff) | |
| download | thoughts-7e2e42379cb40a500eb8a236c05788eb3e84d141.tar.gz thoughts-7e2e42379cb40a500eb8a236c05788eb3e84d141.tar.bz2 thoughts-7e2e42379cb40a500eb8a236c05788eb3e84d141.zip | |
Added logging in and logging out
Diffstat (limited to 'app/controllers/users')
| -rw-r--r-- | app/controllers/users/confirmations_controller.rb | 28 | ||||
| -rw-r--r-- | app/controllers/users/omniauth_callbacks_controller.rb | 28 | ||||
| -rw-r--r-- | app/controllers/users/passwords_controller.rb | 32 | ||||
| -rw-r--r-- | app/controllers/users/registrations_controller.rb | 60 | ||||
| -rw-r--r-- | app/controllers/users/sessions_controller.rb | 26 | ||||
| -rw-r--r-- | app/controllers/users/unlocks_controller.rb | 28 | 
6 files changed, 202 insertions, 0 deletions
| diff --git a/app/controllers/users/confirmations_controller.rb b/app/controllers/users/confirmations_controller.rb new file mode 100644 index 0000000..1126e23 --- /dev/null +++ b/app/controllers/users/confirmations_controller.rb | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | class Users::ConfirmationsController < Devise::ConfirmationsController | ||
| 2 | # GET /resource/confirmation/new | ||
| 3 | # def new | ||
| 4 | # super | ||
| 5 | # end | ||
| 6 | |||
| 7 | # POST /resource/confirmation | ||
| 8 | # def create | ||
| 9 | # super | ||
| 10 | # end | ||
| 11 | |||
| 12 | # GET /resource/confirmation?confirmation_token=abcdef | ||
| 13 | # def show | ||
| 14 | # super | ||
| 15 | # end | ||
| 16 | |||
| 17 | # protected | ||
| 18 | |||
| 19 | # The path used after resending confirmation instructions. | ||
| 20 | # def after_resending_confirmation_instructions_path_for(resource_name) | ||
| 21 | # super(resource_name) | ||
| 22 | # end | ||
| 23 | |||
| 24 | # The path used after confirmation. | ||
| 25 | # def after_confirmation_path_for(resource_name, resource) | ||
| 26 | # super(resource_name, resource) | ||
| 27 | # end | ||
| 28 | end | ||
| diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb new file mode 100644 index 0000000..1907e5b --- /dev/null +++ b/app/controllers/users/omniauth_callbacks_controller.rb | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController | ||
| 2 | # You should configure your model like this: | ||
| 3 | # devise :omniauthable, omniauth_providers: [:twitter] | ||
| 4 | |||
| 5 | # You should also create an action method in this controller like this: | ||
| 6 | # def twitter | ||
| 7 | # end | ||
| 8 | |||
| 9 | # More info at: | ||
| 10 | # https://github.com/plataformatec/devise#omniauth | ||
| 11 | |||
| 12 | # GET|POST /resource/auth/twitter | ||
| 13 | # def passthru | ||
| 14 | # super | ||
| 15 | # end | ||
| 16 | |||
| 17 | # GET|POST /users/auth/twitter/callback | ||
| 18 | # def failure | ||
| 19 | # super | ||
| 20 | # end | ||
| 21 | |||
| 22 | # protected | ||
| 23 | |||
| 24 | # The path used when OmniAuth fails | ||
| 25 | # def after_omniauth_failure_path_for(scope) | ||
| 26 | # super(scope) | ||
| 27 | # end | ||
| 28 | end | ||
| diff --git a/app/controllers/users/passwords_controller.rb b/app/controllers/users/passwords_controller.rb new file mode 100644 index 0000000..53cc34e --- /dev/null +++ b/app/controllers/users/passwords_controller.rb | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | class Users::PasswordsController < Devise::PasswordsController | ||
| 2 | # GET /resource/password/new | ||
| 3 | # def new | ||
| 4 | # super | ||
| 5 | # end | ||
| 6 | |||
| 7 | # POST /resource/password | ||
| 8 | # def create | ||
| 9 | # super | ||
| 10 | # end | ||
| 11 | |||
| 12 | # GET /resource/password/edit?reset_password_token=abcdef | ||
| 13 | # def edit | ||
| 14 | # super | ||
| 15 | # end | ||
| 16 | |||
| 17 | # PUT /resource/password | ||
| 18 | # def update | ||
| 19 | # super | ||
| 20 | # end | ||
| 21 | |||
| 22 | # protected | ||
| 23 | |||
| 24 | # def after_resetting_password_path_for(resource) | ||
| 25 | # super(resource) | ||
| 26 | # end | ||
| 27 | |||
| 28 | # The path used after sending reset password instructions | ||
| 29 | # def after_sending_reset_password_instructions_path_for(resource_name) | ||
| 30 | # super(resource_name) | ||
| 31 | # end | ||
| 32 | end | ||
| diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb new file mode 100644 index 0000000..4d6fbad --- /dev/null +++ b/app/controllers/users/registrations_controller.rb | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | class Users::RegistrationsController < Devise::RegistrationsController | ||
| 2 | # before_action :configure_sign_up_params, only: [:create] | ||
| 3 | # before_action :configure_account_update_params, only: [:update] | ||
| 4 | |||
| 5 | # GET /resource/sign_up | ||
| 6 | # def new | ||
| 7 | # super | ||
| 8 | # end | ||
| 9 | |||
| 10 | # POST /resource | ||
| 11 | # def create | ||
| 12 | # super | ||
| 13 | # end | ||
| 14 | |||
| 15 | # GET /resource/edit | ||
| 16 | # def edit | ||
| 17 | # super | ||
| 18 | # end | ||
| 19 | |||
| 20 | # PUT /resource | ||
| 21 | # def update | ||
| 22 | # super | ||
| 23 | # end | ||
| 24 | |||
| 25 | # DELETE /resource | ||
| 26 | # def destroy | ||
| 27 | # super | ||
| 28 | # end | ||
| 29 | |||
| 30 | # GET /resource/cancel | ||
| 31 | # Forces the session data which is usually expired after sign | ||
| 32 | # in to be expired now. This is useful if the user wants to | ||
| 33 | # cancel oauth signing in/up in the middle of the process, | ||
| 34 | # removing all OAuth session data. | ||
| 35 | # def cancel | ||
| 36 | # super | ||
| 37 | # end | ||
| 38 | |||
| 39 | # protected | ||
| 40 | |||
| 41 | # If you have extra params to permit, append them to the sanitizer. | ||
| 42 | # def configure_sign_up_params | ||
| 43 | # devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute]) | ||
| 44 | # end | ||
| 45 | |||
| 46 | # If you have extra params to permit, append them to the sanitizer. | ||
| 47 | # def configure_account_update_params | ||
| 48 | # devise_parameter_sanitizer.permit(:account_update, keys: [:attribute]) | ||
| 49 | # end | ||
| 50 | |||
| 51 | # The path used after sign up. | ||
| 52 | # def after_sign_up_path_for(resource) | ||
| 53 | # super(resource) | ||
| 54 | # end | ||
| 55 | |||
| 56 | # The path used after sign up for inactive accounts. | ||
| 57 | # def after_inactive_sign_up_path_for(resource) | ||
| 58 | # super(resource) | ||
| 59 | # end | ||
| 60 | end | ||
| diff --git a/app/controllers/users/sessions_controller.rb b/app/controllers/users/sessions_controller.rb new file mode 100644 index 0000000..889fba5 --- /dev/null +++ b/app/controllers/users/sessions_controller.rb | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | class Users::SessionsController < Devise::SessionsController | ||
| 2 | layout "userdata" | ||
| 3 | # before_action :configure_sign_in_params, only: [:create] | ||
| 4 | |||
| 5 | # GET /resource/sign_in | ||
| 6 | # def new | ||
| 7 | # super | ||
| 8 | # end | ||
| 9 | |||
| 10 | # POST /resource/sign_in | ||
| 11 | # def create | ||
| 12 | # super | ||
| 13 | # end | ||
| 14 | |||
| 15 | # DELETE /resource/sign_out | ||
| 16 | # def destroy | ||
| 17 | # super | ||
| 18 | # end | ||
| 19 | |||
| 20 | # protected | ||
| 21 | |||
| 22 | # If you have extra params to permit, append them to the sanitizer. | ||
| 23 | # def configure_sign_in_params | ||
| 24 | # devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute]) | ||
| 25 | # end | ||
| 26 | end | ||
| diff --git a/app/controllers/users/unlocks_controller.rb b/app/controllers/users/unlocks_controller.rb new file mode 100644 index 0000000..8b9ef86 --- /dev/null +++ b/app/controllers/users/unlocks_controller.rb | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | class Users::UnlocksController < Devise::UnlocksController | ||
| 2 | # GET /resource/unlock/new | ||
| 3 | # def new | ||
| 4 | # super | ||
| 5 | # end | ||
| 6 | |||
| 7 | # POST /resource/unlock | ||
| 8 | # def create | ||
| 9 | # super | ||
| 10 | # end | ||
| 11 | |||
| 12 | # GET /resource/unlock?unlock_token=abcdef | ||
| 13 | # def show | ||
| 14 | # super | ||
| 15 | # end | ||
| 16 | |||
| 17 | # protected | ||
| 18 | |||
| 19 | # The path used after sending unlock password instructions | ||
| 20 | # def after_sending_unlock_instructions_path_for(resource) | ||
| 21 | # super(resource) | ||
| 22 | # end | ||
| 23 | |||
| 24 | # The path used after unlocking the resource | ||
| 25 | # def after_unlock_path_for(resource) | ||
| 26 | # super(resource) | ||
| 27 | # end | ||
| 28 | end | ||
