Skip to content

Conversation

peaceful-james
Copy link
Contributor

Overview

Resolves #87 (I think)

What problem is being solved by this branch?

Basically, when registering, we specify "platform" or "cross-platform". If using, e.g. YubiKey, then it must be "cross-platform".

We used to have "platform" hardcoded so it could not be worked around.

Changes

I added an extra button to the RegistrationComponent, for cross-platform.

Default button label is "Sign Up With Connected Device" but it can be customized.

See this screenshot of platform and cross-platform registration buttons being rendered with custom labels.

Screenshot 2025-08-31 210745

I made 1 cheeky extra change which was to remove some camelCase atoms (which cause compiler warnings, which is not pleasant). These atoms were simply map keys and that map was just being sent to the client (JS) so switching to string keys should cause no issues.

Tests

Some broke, I fixed them.

Collaborators

  1. @type1fool
  2. more_collabs

@peaceful-james peaceful-james marked this pull request as draft August 31, 2025 20:54
@peaceful-james peaceful-james marked this pull request as ready for review August 31, 2025 21:21
@type1fool type1fool self-requested a review September 8, 2025 23:30
@type1fool type1fool added the triage Needs to be prioritized label Sep 8, 2025
@type1fool
Copy link
Collaborator

Thank you for opening this PR, @peaceful-james! The code changes are minimal and straightforward.

The only problem I see is that we're forcing users to accept both forms of credentials. This sounds nice as a default, but I expect some users will want a bit more control. Would it make sense to allow rendering two (or more) RegistrationComponents with different configurations? That way, devs would be able to customize the appearance & layout of the buttons.

What do you think?

@type1fool type1fool added question Further information is requested and removed triage Needs to be prioritized labels Sep 15, 2025
@peaceful-james
Copy link
Contributor Author

allow rendering two (or more) RegistrationComponents with different configurations

@type1fool Yes that is a good idea. I will look into this.

@peaceful-james
Copy link
Contributor Author

@type1fool I gave it a quick go tonight. It definitely feels better than it was. Interested in getting your eyes on it before I fix tests.

Copy link
Collaborator

@type1fool type1fool left a comment

Choose a reason for hiding this comment

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

Much improved. Just a few minor nits.

@type1fool type1fool self-requested a review September 18, 2025 19:48
Bug in AuthenticationComponent whereby
challenge was being assigned as a fxn
@peaceful-james
Copy link
Contributor Author

@type1fool I snuck in a fix for what seems to be a typo in the authentication component (see last commit).

Copy link
Collaborator

@type1fool type1fool left a comment

Choose a reason for hiding this comment

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

I haven't yet run the generator in a demo repo, but the changes look good overall. My last complaint is about the button change.

<span><%= @display_text %></span>
</.button>
</span>
<button
Copy link
Collaborator

Choose a reason for hiding this comment

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

I could go either way on sticking with the base button component or using the raw HTML button. However there are two issues:

  1. AuthenticationComponent still uses the base component.
  2. This change is out of scope for supporting cross-platform credentials.

In projects, I do tend to apply more styling to HTML elements in CSS to reduce component maintenance and complexity. A discussion about sensible defaults would be good before making this change.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I opened #99 to start the conversation for this topic.

@type1fool type1fool removed the question Further information is requested label Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REQUEST] - Support Non-Platform Credentials

2 participants