Skip to content

Commit

Permalink
Fix login
Browse files Browse the repository at this point in the history
  • Loading branch information
saeed-zil committed May 30, 2024
1 parent 37bfe3b commit 8b4de21
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
6 changes: 1 addition & 5 deletions src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ export interface ClientKey {
}

export const isAuthenticated = () => {
if (!LocalStorage.hasItem('node-authorized')) {
return false
}

return LocalStorage.getItem('node-authorized')
return LocalStorage.hasItem('client-key')
}

export const getClientKey = (): ClientKey | null => {
Expand Down
25 changes: 12 additions & 13 deletions src/components/NearLogin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,33 @@
</wallet-ctx-provider-vue>
</template>
<script>
import { applyPureReactInVue } from "veaury";
import { applyPureReactInVue } from 'veaury'
// This is a React component
import { WalletSelectorContextProvider } from "@calimero-is-near/calimero-p2p-sdk/lib/wallet/NearLogin/WalletSelectorContext";
import NearLogin from "@calimero-is-near/calimero-p2p-sdk/lib/wallet/NearLogin/NearLogin";
import { WalletSelectorContextProvider } from '@calimero-is-near/calimero-p2p-sdk/lib/wallet/NearLogin/WalletSelectorContext'
import NearLogin from '@calimero-is-near/calimero-p2p-sdk/lib/wallet/NearLogin/NearLogin'
import { ref } from "vue";
import { useRouter } from "vue-router";
import { useRouter } from 'vue-router'
export default {
components: {
// Use HOC 'applyReactInVue' or 'applyPureReactInVue'
WalletCtxProviderVue: applyPureReactInVue(WalletSelectorContextProvider),
NearLoginVue: applyPureReactInVue(NearLogin),
NearLoginVue: applyPureReactInVue(NearLogin)
},
setup() {
const router = useRouter();
const router = useRouter()
function success() {
router.push("/");
router.push('/')
}
function auth() {
router.push("/login");
router.push('/')
}
return {
success,
auth,
};
},
};
auth
}
}
}
</script>

0 comments on commit 8b4de21

Please sign in to comment.