This commit is contained in:
Karolis2011
2021-12-23 06:42:40 +02:00
parent cad4268b79
commit b367854887
23 changed files with 4103 additions and 2049 deletions

View File

@@ -12,9 +12,7 @@
</div>
<template v-if="$store.state.msalAuth.isAdmin">
<div class="alert alert-warning">
<span>
Tu esi administratorius.
</span>
<span> Tu esi administratorius. </span>
</div>
<h3>Prieigos raktas (Access token)</h3>
<a
@@ -59,7 +57,7 @@
</template>
<script>
import axios from 'axios'
import { authAxios } from '@/axios'
export default {
data() {
@@ -70,31 +68,23 @@ export default {
methods: {
serverVerify() {
this.verificationResult = null
axios
.get('/api/AuthMetadata/authed', {
headers: {
Authorization: `Bearer ${this.$store.state.msalAuth.idToken}`,
},
})
.then(response => {
authAxios
.get('/api/AuthMetadata/authed')
.then((response) => {
this.verificationResult = response.data
})
.catch(function(error) {
.catch(function (error) {
alert(error)
})
},
serverAdminVerify() {
this.verificationResult = null
axios
.get('/api/AuthMetadata/Admin', {
headers: {
Authorization: `Bearer ${this.$store.state.msalAuth.idToken}`,
},
})
.then(response => {
authAxios
.get('/api/AuthMetadata/Admin')
.then((response) => {
this.verificationResult = response.data
})
.catch(function(error) {
.catch(function (error) {
alert(error)
})
},