Redirect to LinkDevice on successful registration

This commit is contained in:
Jess Martin 2022-07-27 12:59:22 -04:00
parent 1d7ef2d819
commit f3cafb40be
6 changed files with 18 additions and 14 deletions

14
package-lock.json generated
View File

@ -8,7 +8,7 @@
"name": "svelte-elemetary-template", "name": "svelte-elemetary-template",
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"webnative": "0.33.0-alpha-2" "webnative": "0.33.0-alpha-3"
}, },
"devDependencies": { "devDependencies": {
"@sveltejs/adapter-static": "1.0.0-next.36", "@sveltejs/adapter-static": "1.0.0-next.36",
@ -4679,9 +4679,9 @@
} }
}, },
"node_modules/webnative": { "node_modules/webnative": {
"version": "0.33.0-alpha-2", "version": "0.33.0-alpha-3",
"resolved": "https://registry.npmjs.org/webnative/-/webnative-0.33.0-alpha-2.tgz", "resolved": "https://registry.npmjs.org/webnative/-/webnative-0.33.0-alpha-3.tgz",
"integrity": "sha512-S9UzS9PKTdgaoplBrlgsk5T7IYcpKMbTxXzg1jxkrVPiHJpuBLC5l+t4GkLTMyalaRMBO6JzlL5qaE51j3j2dw==", "integrity": "sha512-fx7ZNk1eKdt88RHG90fKg99xhBKsPIizOEgggr0HYrbM9G9O4vXGabt48QQF6K9pTuZmrrSW/RyqR/bxCHRc6A==",
"dependencies": { "dependencies": {
"@ipld/dag-cbor": "^7.0.0", "@ipld/dag-cbor": "^7.0.0",
"@ipld/dag-pb": "^2.1.15", "@ipld/dag-pb": "^2.1.15",
@ -8069,9 +8069,9 @@
"peer": true "peer": true
}, },
"webnative": { "webnative": {
"version": "0.33.0-alpha-2", "version": "0.33.0-alpha-3",
"resolved": "https://registry.npmjs.org/webnative/-/webnative-0.33.0-alpha-2.tgz", "resolved": "https://registry.npmjs.org/webnative/-/webnative-0.33.0-alpha-3.tgz",
"integrity": "sha512-S9UzS9PKTdgaoplBrlgsk5T7IYcpKMbTxXzg1jxkrVPiHJpuBLC5l+t4GkLTMyalaRMBO6JzlL5qaE51j3j2dw==", "integrity": "sha512-fx7ZNk1eKdt88RHG90fKg99xhBKsPIizOEgggr0HYrbM9G9O4vXGabt48QQF6K9pTuZmrrSW/RyqR/bxCHRc6A==",
"requires": { "requires": {
"@ipld/dag-cbor": "^7.0.0", "@ipld/dag-cbor": "^7.0.0",
"@ipld/dag-pb": "^2.1.15", "@ipld/dag-pb": "^2.1.15",

View File

@ -50,6 +50,6 @@
] ]
}, },
"dependencies": { "dependencies": {
"webnative": "0.33.0-alpha-2" "webnative": "0.33.0-alpha-3"
} }
} }

View File

@ -0,0 +1 @@
<h1>Link Device</h1>

View File

@ -32,9 +32,8 @@
const registerUser = async (event: Event) => { const registerUser = async (event: Event) => {
registrationSuccess = await register(username) registrationSuccess = await register(username)
console.log('registration success: ', registrationSuccess)
if (registrationSuccess) { if (registrationSuccess) {
// Redirect to device linking? window.location.href = '/linkDevice'
} }
} }
</script> </script>

View File

@ -58,10 +58,9 @@ export const isUsernameAvailable = async (
} }
export const register = async (username: string): Promise<boolean> => { export const register = async (username: string): Promise<boolean> => {
const { success } = await webnative.account.register({ await initialize()
username, const { success } = await webnative.account.register({ username })
email: 'null@null.com'
})
return success return success
} }

View File

@ -0,0 +1,5 @@
<script lang="ts">
import LinkDevice from '$components/auth/LinkDevice.svelte'
</script>
<LinkDevice />