Skip to content

Commit

Permalink
Merge pull request #6 from hypersign-protocol/v2.0
Browse files Browse the repository at this point in the history
Login with google btn added
  • Loading branch information
Vishwas1 authored Jul 28, 2021
2 parents 9c88e92 + 4842308 commit 6aea227
Show file tree
Hide file tree
Showing 3 changed files with 245 additions and 2 deletions.
214 changes: 213 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"@zxing/library": "^0.17.1",
"aepp-raendom": "github:aeternity/aepp-raendom#feature/layout-superhero",
"aeternity-tokens": "^1.0.2",
"auth0-js": "^9.16.2",
"axios": "^0.19.0",
"bignumber.js": "^8.1.1",
"bluebird": "^3.7.1",
Expand Down Expand Up @@ -147,4 +148,4 @@
"android"
]
}
}
}
30 changes: 30 additions & 0 deletions src/popup/router/pages/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@
{{ $t('pages.index.generateWallet') }}
</Button>
<label class="sett_info">OR</label>
<Button @click="loginWithGoogle" data-cy="login-with-google">
Continue with Google
</Button>
<br/>

<a href="#" @click="gotoRestore">{{ $t('pages.index.restoreWallet') }}</a>
<!-- <Button @click="gotoRestore" :disabled="!termsAgreed">
{{ $t('pages.index.restoreWallet') }}
Expand All @@ -61,6 +65,7 @@ import Input from '../components/Input-light';
import registration from '../../../mixins/registration';
import HypersignSsiSDK from 'hs-ssi-sdk';
import { HS_NODE_BASE_URL } from '../../utils/hsConstants'
import auth0 from "auth0-js";
export default {
mixins: [registration],
components: { Logo,Input, SuperheroLogo, CheckBox, Button, Platforms },
Expand All @@ -71,6 +76,31 @@ export default {
loading: false
}),
methods: {
loginWithGoogle(){
const newWebAuth = new auth0.WebAuth({
domain: "fidato.us.auth0.com",
clientID: "hwM9GmM4nUstds9Fw5KsYZVDboJBeLTL",
responseType: "token id_token",
scope: "openid profile email",
// redirectUri: window.location.origin + "/app/admin/login",
})
newWebAuth.popup.authorize(
{
connection: "google-oauth2",
owp: true
},
function (err, authRes) {
console.log(authRes, err)
if(!err){
newWebAuth.client.userInfo(authRes.accessToken, function(err, user) {
console.log(err, user)
})
}
});
},
gotoRestore(){
this.$router.push('restoreWallet')
},
Expand Down

0 comments on commit 6aea227

Please sign in to comment.