Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ac998c2
feat: remove credential.js
rafaella-martino Aug 11, 2025
1532925
feat: remove ajax, rename controllers actions, use js alerts to displ…
rafaella-martino Aug 13, 2025
cb11999
feat: remove `message.js` as it is no longer used
rafaella-martino Aug 13, 2025
521b0c2
feat: remove unused js targets
rafaella-martino Aug 13, 2025
7bddc67
feat: replace `fetch` for `submit`, change `credential` param name to…
rafaella-martino Aug 13, 2025
871ab25
test: update test with renamed params
rafaella-martino Aug 14, 2025
cbf503e
feat: change `.then` for `await` for readability
rafaella-martino Aug 14, 2025
a990e01
feat: add permitted params in controllers
rafaella-martino Aug 14, 2025
bd72e31
feat: pass url as values, add token to session js controller
rafaella-martino Aug 15, 2025
6115812
feat: merge js controllers into one
rafaella-martino Aug 15, 2025
e19ef24
feat: change submit buttons, rename js controller variables
rafaella-martino Aug 15, 2025
9b46e85
fix: attend deprecation warning
rafaella-martino Aug 15, 2025
6fe61ca
Merge branch 'master' into rm--refactor_js
rafaella-martino Aug 15, 2025
6002921
style: use rails button helpers
rafaella-martino Aug 15, 2025
e93e3e8
feat: use `expect` to require params
rafaella-martino Aug 15, 2025
95b5664
feat: change `create_options` and `get_options` controller actions for
rafaella-martino Aug 18, 2025
331859e
fix: add space in css
rafaella-martino Aug 18, 2025
c42c9fc
rollback: use messenger.js to display error messages
rafaella-martino Aug 18, 2025
7a35c2c
feat: use `requestjs` gem
rafaella-martino Aug 18, 2025
81ad153
fix: Display layout instead of json when Webauthn Verification error
rafaella-martino Aug 18, 2025
c2753ed
feat: use render instead of redirect when request fails, use flash for
rafaella-martino Aug 19, 2025
1c92613
feat: Change variable names in JS controller
rafaella-martino Aug 19, 2025
5307cb1
refactor: move `request.js` import with the rest of the imports
rafaella-martino Sep 3, 2025
449c9cb
refactor: temporarily use `redirect` when `create` credential fails,
rafaella-martino Sep 3, 2025
e8b7ea3
refactor: enabling `submit` button when clicking `Cancel` with js
rafaella-martino Sep 10, 2025
9e58703
feat: clear not saved credential if there is an error
rafaella-martino Sep 10, 2025
672bcb1
Merge branch 'master' into rm--refactor_js
rafaella-martino Sep 11, 2025
b9edbe2
make rubocop happy
rafaella-martino Sep 11, 2025
23a316e
refactor: remove unnecessary cleanup when error updating credential
rafaella-martino Sep 11, 2025
55e10a6
rollback handling Webauthn Error exception
rafaella-martino Sep 11, 2025
e35488d
refactor: rollback to use json responses in case of errors
rafaella-martino Sep 12, 2025
3accfb1
refactor: leave controller response for next PR, rollback to respond
rafaella-martino Sep 12, 2025
18b76a5
change response message if registration success
rafaella-martino Sep 12, 2025
72e5f40
test: add new controller changes
rafaella-martino Sep 12, 2025
82a766f
stop displaying message
rafaella-martino Sep 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ gem 'bootsnap', '~> 1.18', require: false
gem 'importmap-rails', '~> 2.2'
gem 'propshaft', '~> 1.2'
gem 'puma', '~> 6.6'
gem 'requestjs-rails'
gem "rollbar", "~> 3.6"
gem 'sqlite3', '>= 1.4'
gem 'stimulus-rails', '~> 1.3'
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ GEM
regexp_parser (2.11.1)
reline (0.6.2)
io-console (~> 0.5)
requestjs-rails (0.0.13)
railties (>= 7.1.0)
rexml (3.4.1)
rollbar (3.6.2)
rubocop (1.79.2)
Expand Down Expand Up @@ -342,6 +344,7 @@ DEPENDENCIES
puma (~> 6.6)
rack-mini-profiler (~> 4.0)
rails (~> 8.0.1)
requestjs-rails
rollbar (~> 3.6)
rubocop (~> 1.79)
rubocop-rails (~> 2.33)
Expand Down
1 change: 1 addition & 0 deletions app/javascript/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ import "messenger"
import Rails from "@rails/ujs";

Rails.start();
import "@rails/request.js"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should we move this up along with the rest of the imports?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 changes: 0 additions & 6 deletions app/javascript/controllers/webauthn_credential_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ export default class extends Controller {
const optionsResponse = await fetch(this.optionsUrlValue, {
method: "POST",
body: new FormData(this.element),
headers: {
"X-CSRF-Token": document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")
}
});

const optionsJson = await optionsResponse.json();
Expand All @@ -37,9 +34,6 @@ export default class extends Controller {
const optionsResponse = await fetch(this.optionsUrlValue, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think about naming it response?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1c92613
Like it, I also changed optionsJson to credentialOptionsJson.
Are you okay with this change or is it too long?
As this is a Demo I believe variables should be understandable 🙂

method: "POST",
body: new FormData(this.element),
headers: {
"X-CSRF-Token": document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")
}
});

const optionsJson = await optionsResponse.json();
Expand Down