Skip to content

Commit

Permalink
feat(Consent): allow and reject actions applied
Browse files Browse the repository at this point in the history
  • Loading branch information
ayZagen committed May 4, 2020
1 parent 33151c0 commit 6c7764c
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions src/ui/views/Consent.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<template>
<div class="col elevation-1 pa__8">
<p-form
ref="form"
class="text-center"
method="post"
autocomplete="off"
:action="formAction()"
@submit="submit"
@submit.prevent
>
<img
style="max-height: 150px"
Expand All @@ -33,13 +30,13 @@
<div class="pt-4">
<p-btn
color="success"
type="submit"
@click="allow"
>
<span v-t="'consent.allow'" />
</p-btn>
<p-btn
color="error"
type="submit"
@click="reject"
>
<span v-t="'consent.reject'" />
</p-btn>
Expand All @@ -49,10 +46,12 @@
</template>

<script lang="ts" >
import { defineComponent, reactive } from 'vue';
import PlusAuth from 'plusauth-js';
import { defineComponent, inject } from 'vue';
import { resolveClientLogo } from '../utils';
export default defineComponent({
name: 'Consent',
props: {
Expand All @@ -61,22 +60,13 @@ export default defineComponent({
default: () => ['test', 'test2']
}
},
setup(props){
setup(){
const api = inject('api') as PlusAuth
return {
submit: api.auth.acceptConsent,
reject: api.auth.rejectConsent,
resolveClientLogo,
formAction(){
return '/signup'
},
async submit($event: Event){
$event.preventDefault()
// @ts-ignore
const valid = this.$refs.form?.validate()
if(valid){
// TODO: submit
}
}
}
}
})
Expand Down

0 comments on commit 6c7764c

Please sign in to comment.