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

View File

@ -50,6 +50,6 @@
]
},
"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) => {
registrationSuccess = await register(username)
console.log('registration success: ', registrationSuccess)
if (registrationSuccess) {
// Redirect to device linking?
window.location.href = '/linkDevice'
}
}
</script>

View File

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

View File

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