// === DEFAULT / CUSTOM STYLE ===
// WARNING! always comment out ONE of the two require() calls below.
// 1. use next line to activate CUSTOM STYLE (./src/themes)
// require(./themes/app.${__THEME}.styl
)
// 2. or, use next line to activate DEFAULT QUASAR STYLE
require(quasar/dist/quasar.${__THEME}.css
)
// ==============================
import Vue from 'vue'
import Quasar from 'quasar'
import router from './router'
import vuelidate from 'vuelidate'
import VueResource from 'vue-resource'
import VueAuthenticate from 'vue-authenticate'
Vue.use(Quasar) // Install Quasar Framework
Vue.use(vuelidate)
// TODO use axios instead of vueresource
Vue.use(VueResource)
// TODO move to separate file
Vue.use(VueAuthenticate, {
baseUrl: 'http://localhost:8080',
providers: {
oauth2: {
name: 'oauth2',
url: 'Token/Exchange',
authorizationEndpoint: 'http://localhost:5000/connect/authorize', // if this ends with slash --> game over
redirectUri: window.location.origin || window.location.protocol + '//' + window.location.host,
scope: ['profile', 'openid', 'PanelButlerApi'],
responseParams: {
code: 'code',
clientId: 'clientId',
redirectUri: 'redirectUri'
},
responseType: 'code',
// responseParams: {
// code: 'code',
// token: 'access_token',
// state: 'state',
// sessionState: 'session_state',
// clientId: 'clientId',
// redirectUri: 'redirectUri'
// },
scopePrefix: '',
scopeDelimiter: ' ',
// defaultUrlParams: ['client_id', 'scope', 'response_type', 'redirect_uri', 'state', 'nonce'],
defaultUrlParams: ['response_type', 'client_id', 'redirect_uri'],
requiredUrlParams: ['scope', 'nonce'],
optionalUrlParams: ['display', 'state'],
state: function () {
var val = ((Date.now() + Math.random()) * Math.random()).toString().replace('.', '')
return encodeURIComponent(val)
},
display: 'popup',
oauthType: '2.0',
clientId: 'PanelButlerVueJs',
nonce: function () {
var val = ((Date.now() + Math.random()) * Math.random()).toString().replace('.', '')
return encodeURIComponent(val)
},
popupOptions: { width: 452, height: 633 }
}
}
})
Quasar.start(() => {
/ eslint-disable no-new /
new Vue({
el: '#q-app',
router,
render: h => h(require('./App'))
})
})
yes indeed, and this is how I make call to api:
<template>
<!-- root node required -->
<div>
<!-- your content -->
<div class="layout-padding">
<div>Identity</div>
<pre>{{identityData }}</pre>
</div>
</div>
</template>
<script>
export default {
data () {
return {
identityData: {}
}
},
created () {
let url = '/api/Identity'
// let token = this.$auth.getToken()
debugger
this.$http
// .get(url, {headers: {'Authorization': 'Bearer ' + token}})
.get(url)
.then(response => { this.identityData = response.data })
}
}
</script>
<style>
</style>