Activation : reset user password
This commit is contained in:
parent
2b2a4c3f0a
commit
5bb98a2863
13 changed files with 117 additions and 174 deletions
2
Gemfile
2
Gemfile
|
@ -74,8 +74,6 @@ gem 'mailjet'
|
||||||
|
|
||||||
gem "smart_listing"
|
gem "smart_listing"
|
||||||
|
|
||||||
gem 'swagger-docs'
|
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
gem 'capybara'
|
gem 'capybara'
|
||||||
gem 'factory_girl'
|
gem 'factory_girl'
|
||||||
|
|
|
@ -380,9 +380,6 @@ GEM
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
sprockets (>= 2.8, < 4.0)
|
sprockets (>= 2.8, < 4.0)
|
||||||
swagger-docs (0.2.8)
|
|
||||||
activesupport (>= 3, < 5)
|
|
||||||
rails (>= 3, < 5)
|
|
||||||
swd (1.0.0)
|
swd (1.0.0)
|
||||||
activesupport (>= 3)
|
activesupport (>= 3)
|
||||||
attr_required (>= 0.0.5)
|
attr_required (>= 0.0.5)
|
||||||
|
@ -496,7 +493,6 @@ DEPENDENCIES
|
||||||
smart_listing
|
smart_listing
|
||||||
spring
|
spring
|
||||||
spring-commands-rspec
|
spring-commands-rspec
|
||||||
swagger-docs
|
|
||||||
terminal-notifier
|
terminal-notifier
|
||||||
terminal-notifier-guard
|
terminal-notifier-guard
|
||||||
therubyracer
|
therubyracer
|
||||||
|
@ -509,4 +505,4 @@ DEPENDENCIES
|
||||||
will_paginate-bootstrap
|
will_paginate-bootstrap
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.10.6
|
1.11.2
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
{
|
|
||||||
"apiVersion": "1.0",
|
|
||||||
"swaggerVersion": "1.2",
|
|
||||||
"basePath": "https://tps.apientreprise.fr",
|
|
||||||
"apis": [
|
|
||||||
{
|
|
||||||
"path": "/api/v1/procedures.{format}",
|
|
||||||
"description": "Procédure API"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"authorizations": null,
|
|
||||||
"info": {
|
|
||||||
"title": "TPS application",
|
|
||||||
"description": "Doc des APIs de TPS",
|
|
||||||
"contact": "contact@tps.apientreprise.fr",
|
|
||||||
"license": "Apache 2.0",
|
|
||||||
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
{
|
|
||||||
"apiVersion": "1.0",
|
|
||||||
"swaggerVersion": "1.2",
|
|
||||||
"basePath": "https://tps.apientreprise.fr",
|
|
||||||
"resourcePath": "procedures",
|
|
||||||
"apis": [
|
|
||||||
{
|
|
||||||
"path": "/api/v1/procedures/{id}.json",
|
|
||||||
"operations": [
|
|
||||||
{
|
|
||||||
"summary": "Récupérer les informations d'une procédure",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"paramType": "path",
|
|
||||||
"name": "id",
|
|
||||||
"type": "integer",
|
|
||||||
"description": null,
|
|
||||||
"required": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responseMessages": [
|
|
||||||
{
|
|
||||||
"code": 200,
|
|
||||||
"responseModel": "Procedure",
|
|
||||||
"message": "Success"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": 401,
|
|
||||||
"responseModel": null,
|
|
||||||
"message": "Unauthorized"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": 404,
|
|
||||||
"responseModel": null,
|
|
||||||
"message": "Not Found"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"nickname": "API::V1::Procedures#show",
|
|
||||||
"method": "get"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"authorizations": null
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
<h2>Change your password</h2>
|
|
||||||
|
|
||||||
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
|
|
||||||
<%= devise_error_messages! %>
|
|
||||||
<%= f.hidden_field :reset_password_token %>
|
|
||||||
|
|
||||||
<div class="field">
|
|
||||||
<%= f.label :password, "New password" %><br />
|
|
||||||
<%= f.password_field :password, autofocus: true, autocomplete: "off" %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="field">
|
|
||||||
<%= f.label :password_confirmation, "Confirm new password" %><br />
|
|
||||||
<%= f.password_field :password_confirmation, autocomplete: "off" %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="actions">
|
|
||||||
<%= f.submit "Change my password" %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<%= render "users/shared/links" %>
|
|
59
app/views/users/passwords/edit.html.haml
Normal file
59
app/views/users/passwords/edit.html.haml
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
-#<h2>Sign up</h2>
|
||||||
|
-#
|
||||||
|
-#<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
||||||
|
-# <%= devise_error_messages! %>
|
||||||
|
-#
|
||||||
|
-# <div class="field">
|
||||||
|
-# <%= f.label :email %><br />
|
||||||
|
-# <%= f.email_field :email, autofocus: true %>
|
||||||
|
-# </div>
|
||||||
|
-#
|
||||||
|
-# <div class="field">
|
||||||
|
-# <%= f.label :password %>
|
||||||
|
-# <% if @validatable %>
|
||||||
|
-# <em>(<%= @minimum_password_length %> characters minimum)</em>
|
||||||
|
-# <% end %><br />
|
||||||
|
-# <%= f.password_field :password, autocomplete: "off" %>
|
||||||
|
-# </div>
|
||||||
|
-#
|
||||||
|
-# <div class="field">
|
||||||
|
-# <%= f.label :password_confirmation %><br />
|
||||||
|
-# <%= f.password_field :password_confirmation, autocomplete: "off" %>
|
||||||
|
-# </div>
|
||||||
|
-#
|
||||||
|
-# <div class="actions">
|
||||||
|
-# <%= f.submit "Sign up" %>
|
||||||
|
-# </div>
|
||||||
|
-#<% end %>
|
||||||
|
|
||||||
|
= devise_error_messages!
|
||||||
|
|
||||||
|
#form_login
|
||||||
|
= image_tag('logo-tps.png')
|
||||||
|
%br
|
||||||
|
%h2#gestionnaire_login Changement de mot de passe
|
||||||
|
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
#new_user
|
||||||
|
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
|
||||||
|
= f.hidden_field :reset_password_token
|
||||||
|
%h4
|
||||||
|
= f.label 'Nouveau mot de passe'
|
||||||
|
|
||||||
|
.input-group
|
||||||
|
.input-group-addon
|
||||||
|
%span.glyphicon.glyphicon-asterisk
|
||||||
|
= f.password_field :password, autofocus: true, autocomplete: "off", class: 'form-control'
|
||||||
|
%br
|
||||||
|
%h4
|
||||||
|
= f.label 'Retaper le mot de passe'
|
||||||
|
.input-group
|
||||||
|
.input-group-addon
|
||||||
|
%span.glyphicon.glyphicon-asterisk
|
||||||
|
= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control'
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
.actions
|
||||||
|
= f.submit "Changer", class:'btn btn-primary'
|
||||||
|
%br
|
|
@ -1,16 +0,0 @@
|
||||||
<h2>Forgot your password?</h2>
|
|
||||||
|
|
||||||
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
|
||||||
<%= devise_error_messages! %>
|
|
||||||
|
|
||||||
<div class="field">
|
|
||||||
<%= f.label :email %><br />
|
|
||||||
<%= f.email_field :email, autofocus: true %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="actions">
|
|
||||||
<%= f.submit "Send me reset password instructions" %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<%= render "users/shared/links" %>
|
|
50
app/views/users/passwords/new.html.haml
Normal file
50
app/views/users/passwords/new.html.haml
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
-#<h2>Sign up</h2>
|
||||||
|
-#
|
||||||
|
-#<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
||||||
|
-# <%= devise_error_messages! %>
|
||||||
|
-#
|
||||||
|
-# <div class="field">
|
||||||
|
-# <%= f.label :email %><br />
|
||||||
|
-# <%= f.email_field :email, autofocus: true %>
|
||||||
|
-# </div>
|
||||||
|
-#
|
||||||
|
-# <div class="field">
|
||||||
|
-# <%= f.label :password %>
|
||||||
|
-# <% if @validatable %>
|
||||||
|
-# <em>(<%= @minimum_password_length %> characters minimum)</em>
|
||||||
|
-# <% end %><br />
|
||||||
|
-# <%= f.password_field :password, autocomplete: "off" %>
|
||||||
|
-# </div>
|
||||||
|
-#
|
||||||
|
-# <div class="field">
|
||||||
|
-# <%= f.label :password_confirmation %><br />
|
||||||
|
-# <%= f.password_field :password_confirmation, autocomplete: "off" %>
|
||||||
|
-# </div>
|
||||||
|
-#
|
||||||
|
-# <div class="actions">
|
||||||
|
-# <%= f.submit "Sign up" %>
|
||||||
|
-# </div>
|
||||||
|
-#<% end %>
|
||||||
|
|
||||||
|
= devise_error_messages!
|
||||||
|
|
||||||
|
#form_login
|
||||||
|
= image_tag('logo-tps.png')
|
||||||
|
%br
|
||||||
|
%h2#gestionnaire_login Mot de passe oublié
|
||||||
|
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
#new_user
|
||||||
|
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
|
||||||
|
%h4
|
||||||
|
= f.label :email
|
||||||
|
.input-group
|
||||||
|
.input-group-addon
|
||||||
|
%span.glyphicon.glyphicon-user
|
||||||
|
= f.email_field :email, class: 'form-control', placeholder: 'Email'
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
.actions
|
||||||
|
= f.submit "Renvoyer", class:'btn btn-primary'
|
||||||
|
%br
|
|
@ -1,39 +0,0 @@
|
||||||
<h2>Edit <%= resource_name.to_s.humanize %></h2>
|
|
||||||
|
|
||||||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
|
||||||
<%= devise_error_messages! %>
|
|
||||||
|
|
||||||
<div class="field">
|
|
||||||
<%= f.label :email %><br />
|
|
||||||
<%= f.email_field :email, autofocus: true %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
|
||||||
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<div class="field">
|
|
||||||
<%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
|
|
||||||
<%= f.password_field :password, autocomplete: "off" %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="field">
|
|
||||||
<%= f.label :password_confirmation %><br />
|
|
||||||
<%= f.password_field :password_confirmation, autocomplete: "off" %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="field">
|
|
||||||
<%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
|
|
||||||
<%= f.password_field :current_password, autocomplete: "off" %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="actions">
|
|
||||||
<%= f.submit "Update" %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<h3>Cancel my account</h3>
|
|
||||||
|
|
||||||
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
|
|
||||||
|
|
||||||
<%= link_to "Back", :back %>
|
|
|
@ -1,3 +1,6 @@
|
||||||
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
||||||
<%= link_to "S'inscrire", new_registration_path(resource_name), {class: 'btn btn-sm btn-success'} %><br />
|
<%= link_to "S'inscrire", new_registration_path(resource_name), {class: 'btn btn-sm btn-success'} %><br />
|
||||||
|
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
<br>
|
||||||
|
<%= link_to "Mot de passe oublié ?", new_password_path(resource_name) %><br />
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
Swagger::Docs::Config.register_apis(
|
|
||||||
{
|
|
||||||
"1.0" => {
|
|
||||||
# the extension used for the API
|
|
||||||
:api_extension_type => :json,
|
|
||||||
# the output location where your .json files are written to
|
|
||||||
:api_file_path => "app/views/docs/",
|
|
||||||
# the URL base path to your API
|
|
||||||
:base_path => "https://tps.apientreprise.fr",
|
|
||||||
# if you want to delete all .json files at each generation
|
|
||||||
:clean_directory => false,
|
|
||||||
# add custom attributes to api-docs
|
|
||||||
:attributes => {
|
|
||||||
:info => {
|
|
||||||
"title" => "TPS application",
|
|
||||||
"description" => "Doc des APIs de TPS",
|
|
||||||
"contact" => "contact@tps.apientreprise.fr",
|
|
||||||
"license" => "Apache 2.0",
|
|
||||||
"licenseUrl" => "http://www.apache.org/licenses/LICENSE-2.0.html"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -10,7 +10,8 @@ Rails.application.routes.draw do
|
||||||
|
|
||||||
devise_for :users, controllers: {
|
devise_for :users, controllers: {
|
||||||
sessions: 'users/sessions',
|
sessions: 'users/sessions',
|
||||||
registrations: 'users/registrations'
|
registrations: 'users/registrations',
|
||||||
|
passwords: 'users/passwords'
|
||||||
}
|
}
|
||||||
|
|
||||||
root 'root#index'
|
root 'root#index'
|
||||||
|
|
2
vendor/assets/javascripts/franceconnect.js
vendored
2
vendor/assets/javascripts/franceconnect.js
vendored
|
@ -10,7 +10,7 @@ var franceConnectKit = {};
|
||||||
//initCurrentHostnameSource();
|
//initCurrentHostnameSource();
|
||||||
//includeFCCss();
|
//includeFCCss();
|
||||||
|
|
||||||
fconnect.currentHost = 'fcp.integ01.dev-franceconnect.fr'
|
fconnect.currentHost = 'fcp.integ01.dev-franceconnect.fr';
|
||||||
|
|
||||||
var fconnectProfile = document.getElementById('fconnect-profile');
|
var fconnectProfile = document.getElementById('fconnect-profile');
|
||||||
if (fconnectProfile) {
|
if (fconnectProfile) {
|
||||||
|
|
Loading…
Reference in a new issue