Skip to content

Commit

Permalink
Added dynamic login for apps
Browse files Browse the repository at this point in the history
  • Loading branch information
didintern committed May 8, 2020
1 parent 82dd7f1 commit 01e9f91
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<script>
export default {
name: 'App',
name: 'App'
}
</script>

Expand Down
7 changes: 6 additions & 1 deletion src/pages/Auth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,17 @@ export default {
this.$store.commit('user/UPDATE_PASSWORD', this.password)
this.$store.commit('user/UPDATE_NAME', this.name)
this.$store.commit('user/UPDATE_EMAIL', this.email)
console.log(x)
this.generate()
.then(res => {
this.onReset()
this.loading = false
})
.catch(err => {
this.loading = false
})
this.loading = false
},
login () {
this.loading = true
Expand Down
57 changes: 24 additions & 33 deletions src/pages/Signtx.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,26 @@
<q-page class="q-pa-lg">
<q-list bordered padding class="rounded-borders" style="max-width: 350px">
<q-item-label header>Your Keys</q-item-label>
<q-item clickable v-ripple>
<q-item clickable v-ripple v-for="app in sortedApps" :key="app.id" >
<q-item-section avatar top>
<q-avatar icon="lock" color="grey" text-color="white" />
</q-item-section>

<q-item-section>
<q-item-label lines="1">Nano SSO</q-item-label>
<q-item-label caption>February 22nd, 2019</q-item-label>
<q-item-label lines="1">{{app.name}}</q-item-label>
<q-item-label caption>{{app.login_time}}</q-item-label>
</q-item-section>

<q-item-section side>
<q-icon name="info" color="orange" />
<q-icon name="info" :color="app.color" />
</q-item-section>
<hr/>
</q-item>
<q-separator spaced ></q-separator>
<q-item clickable v-ripple>
<q-item-section avatar top>
<q-avatar icon="lock" color="grey" text-color="white" />
</q-item-section>

<q-item-section>
<q-item-label lines="1">Hypermine SSO</q-item-label>
<q-item-label caption>September 21st, 2019</q-item-label>
</q-item-section>

<q-item-section side>
<q-icon name="info" color="green" />
</q-item-section>
</q-item>
</q-list>
<q-page-sticky position="bottom-right" :offset="[18, 18]">
<q-fab color="purple" icon="keyboard_arrow_up" direction="up">
<q-fab-action color="primary" @click="onClick" icon="phonelink_ring" />
<!-- <q-fab-action color="primary" @click="onClick" icon="phonelink_ring" /> -->
<q-fab-action color="secondary" @click="onClick" icon="payment" />
</q-fab>
</q-page-sticky>
Expand All @@ -51,7 +38,8 @@ export default {
},
data () {
return {
scanText: 'Quick Brown Fox Jump Over a Lazy Dog'
scanText: 'Quick Brown Fox Jump Over a Lazy Dog',
apps:[]
}
},
methods: {
Expand All @@ -61,24 +49,27 @@ export default {
onClick () {
this.signMessageTx(this.scanText)
.then(res => {
console.log(res)
let data = {
'data': {
'attributes': {
'companyId': 21,
'signedRsv': res,
'publicToken': this.wallet.address[0],
'rawMsg': this.scanText
}
}
}
console.log(JSON.stringify(data))
var today = new Date();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
let app = {}
app.id = Date.now()
app.login_time = time
app.name = 'Ae Laboratory '+'SSO'
app.color = 'green'
this.apps.push(app)
})
.catch(err => {
console.error(err)
})
}
}
},
computed: {
sortedApps() {
return this.apps.reverse
}
},
}
</script>

Expand Down

0 comments on commit 01e9f91

Please sign in to comment.