Updated device auth#1386
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| @@ -1,49 +1,79 @@ | |||
| import { useNavigate, useSearchParams } from 'react-router-dom' | |||
| import { useState } from 'react' | |||
| import AuthCode from 'react-auth-code-input' | |||
There was a problem hiding this comment.
In theory we could do this ourselves, but the library has no dependencies and is only 1kb after bundling. It handles a range of behaviours like pasting a code directly in and dealing with the individual inputs.
|
Hot damn. Very snazzy. |
|
Switched to our own copy with credit to the source. Didn't get the inserted dash working. The implementation assumes that I also tried making it find the next input (i.e., not care that there are garbage spans around) function getNextInputSibling(el: Element): HTMLInputElement | null {
const next = el.nextElementSibling
if (!next) return null
return next.tagName === 'input' ? (next as HTMLInputElement) : getNextInputSibling(next)
}but I couldn't get that to work either. In any case we can figure this out later. |
|
No, I was not aware. https://www.scottohara.me/blog/2014/06/24/pseudo-element-input.html |
|
Ok, I got it. |
724dcf6 to
8938c6d
Compare
|
Lovely jubbly, thanks for those tweaks |



First pass of visual update of device auth page and switching to manual entry of
user_code.Fixes #999