misc passkey prep

This commit is contained in:
2026-04-05 19:19:37 -04:00
parent ea9ad2f8a7
commit 2517cd777f
3 changed files with 19 additions and 10 deletions
+17 -8
View File
@@ -1,27 +1,36 @@
use dioxus::prelude::*;
use web_sys::{CredentialCreationOptions, window};
use crate::components::basic::Button;
#[component]
pub fn PasskeyRegistrationButton() -> Element
{
pub fn PasskeyRegistrationButton() -> Element {
rsx! {
Button{
text: "Register Passkey",
onclick: move |e| {
onclick: move |_| {
start_passkey_registration();
}
}
}
}
fn start_passkey_registration() {}
fn start_passkey_registration() {
create_credential();
}
fn create_credential() {}
fn create_credential() {
let credentials = window()
.expect("Failed to get window")
.navigator()
.credentials();
let opts = CredentialCreationOptions::new();
let _result = credentials.create_with_options(&opts);
}
#[component]
pub fn PasskeyLoginButton() -> Element
{
pub fn PasskeyLoginButton() -> Element {
rsx! {
Button{
text: "Login with Passkey"
+1 -1
View File
@@ -29,7 +29,7 @@ pub fn Media(id: String) -> Element {
#[component]
fn MediaPage(media: MediaModel) -> Element {
let url = media.thumb_url;
let id = media.id.expect("Media has no id").value.clone();
// let id = media.id.expect("Media has no id").value.clone();
let cur_class = use_signal(|| match media.class {
0 => "Standard",
1 => "NSFW",