Skip to content

Commit

Permalink
add loggin with google + metakeep
Browse files Browse the repository at this point in the history
  • Loading branch information
Viterbo committed Dec 13, 2023
1 parent b7e9263 commit 0710c04
Show file tree
Hide file tree
Showing 14 changed files with 940 additions and 192 deletions.
18 changes: 18 additions & 0 deletions .bash_history
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
alias telosmain='cleos --url https://telos.caleos.io '
alias telostest='cleos --url https://testnet.telos.caleos.io '
alias ll='ls -las'
telosmain get info
telostest get info
cleos wallet import --private-key 5HsSMqDdf1gdniM2eiyZ8VDW8cjh9r9VfUWygKPKF2tVU6cwgvf
cleos wallet import --private-key 5JGFskbuaf9fEMnLESz4CPWKBJigiVX9VXcoh7b67WK4VA1e4u5
telostest system newaccount --stake-net "0.5000 TLOS" --stake-cpu "0.5000 TLOS" --buy-ram-kbytes 3 gqydoobuhege vitermetkeep EOS8FyAaCkvzYegJNikJNUjU5x5PPcSHsAW6t6QdnTJg1Js3VJWTE EOS8FyAaCkvzYegJNikJNUjU5x5PPcSHsAW6t6QdnTJg1Js3VJWTE -p gqydoobuhege@active
telostest get info
telostest get info
exit
alias ll='ls -las'
alias telosmain='cleos --url https://telos.caleos.io '
alias telostest='cleos --url https://testnet.telos.caleos.io '
telostest get table --help
telostest get table eosio eosio userres
telostest get table eosio viterbo4test userres
exit
2 changes: 2 additions & 0 deletions env.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const TESTNET = {
CHAIN_NAME: 'telos-testnet',
OREID_APP_ID: 't_75a4d9233ec441d18c4221e92b379197',
OREID_APP_ID_NATIVE: 't_a61e9926d5204387a9ac113dfce7cbc5',
METAKEEP_APP_ID_NATIVE: 'ad5e05fb-280a-41ae-b186-5a2654567b92',
};

const MAINNET = {
Expand All @@ -39,6 +40,7 @@ const MAINNET = {
CHAIN_NAME: 'telos',
OREID_APP_ID: 'p_e5b81fcc20a04339993b0cc80df7e3fd',
OREID_APP_ID_NATIVE: 'p_751f87258d5b40998b55c626d612fd4e',
METAKEEP_APP_ID_NATIVE: 'ad5e05fb-280a-41ae-b186-5a2654567b92',
};

const env = process.env.NETWORK === 'mainnet' ? MAINNET : TESTNET;
Expand Down
2 changes: 2 additions & 0 deletions src/antelope/stores/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ export const useAccountStore = defineStore(store_name, {
localStorage.setItem('isNative', 'true');
localStorage.setItem('autoLogin', authenticator.getName());

console.log('---------------------------------');

success = true;
this.fetchAccountDataFor(CURRENT_CONTEXT, nativeAccount);
getAntelope().events.onLoggedIn.next(nativeAccount);
Expand Down
6 changes: 6 additions & 0 deletions src/antelope/wallets/authenticators/MetaKeepAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,17 @@ export class MetaKeepAuth extends InjectedProviderAuth {

useFeedbackStore().unsetLoading(`${this.getName()}.login`);

localStorage.setItem('metakeep', JSON.stringify({
email: this.accountEmail,
account: this.accountAddress,
}));

return this.accountAddress as addressString;
}

async logout(): Promise<void> {
this.trace('logout');
localStorage.removeItem('metakeep');
return Promise.resolve();
}

Expand Down
Loading

0 comments on commit 0710c04

Please sign in to comment.