Skip to content

Commit

Permalink
fix: redirect to home if already login on register and correctly find…
Browse files Browse the repository at this point in the history
… near key (#1181)
  • Loading branch information
chrispanag authored Oct 5, 2022
1 parent e4dadb2 commit f742b8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/register/SignUp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default Vue.extend({
}
if (this.userInfo.type === `near`) {
// If the key exists we can login him
const pk = window.localStorage.getItem(`near-api-js:${this.userInfo.accountId}:${nearNetwork}`)
const pk = window.localStorage.getItem(`near-api-js:keystore:${this.userInfo.accountId}:${nearNetwork}`)
if (pk) {
this.username = username
await this.verify(this.username)
Expand Down
7 changes: 3 additions & 4 deletions src/pages/register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,13 @@ export default Vue.extend({
walletLogout()
return false
},
async created() {
await this.stepForward()
},
mounted() {
async mounted() {
const accountId = window.localStorage.getItem(`accountId`)
if (this.$store.state.session.id !== `` && accountId) {
this.$router.push(`/home`)
return
}
await this.stepForward()
},
methods: {
...mapMutations(sessionStoreNamespace, {
Expand Down

0 comments on commit f742b8c

Please sign in to comment.