Pass urls to passport vue components to make work in subdirectories. (#4090)

This commit is contained in:
Daniel Meltzer 2017-10-01 16:59:07 -04:00 committed by snipe
parent c2616412c0
commit a2453be573
15 changed files with 37 additions and 63575 deletions

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
{"version":3,"file":"css/AdminLTE.css","sources":[],"mappings":";;;;;;","sourceRoot":""}
{"version":3,"file":"css/AdminLTE.css","sources":[],"mappings":";;;;;;A","sourceRoot":""}

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
{"version":3,"file":"css/app.css","sources":[],"mappings":";;;;;;;;","sourceRoot":""}
{"version":3,"file":"css/app.css","sources":[],"mappings":";;;;;;;;A","sourceRoot":""}

File diff suppressed because one or more lines are too long

View file

@ -3,6 +3,10 @@
"/css/AdminLTE.css": "/css/AdminLTE.css",
"/css/app.css": "/css/app.css",
"/css/overrides.css": "/css/overrides.css",
"/vue.js.map": "/vue.js.map",
"/css/AdminLTE.css.map": "/css/AdminLTE.css.map",
"/css/app.css.map": "/css/app.css.map",
"/css/overrides.css.map": "/css/overrides.css.map",
"/public/css/dist/all.css": "/public/css/dist/all.css",
"/public/js/dist/all.js": "/public/js/dist/all.js"
}

52910
build/vue.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

BIN
public/js/dist/all.js vendored

Binary file not shown.

View file

@ -56,6 +56,7 @@
<script>
export default {
props: ['clientsUrl', 'tokensUrl'],
/*
* The component's data.
*/
@ -91,7 +92,7 @@
* Get all of the authorized tokens for the user.
*/
getTokens() {
this.$http.get('/oauth/tokens')
this.$http.get(this.tokensUrl)
.then(response => {
this.tokens = response.data;
});
@ -101,7 +102,7 @@
* Revoke the given token.
*/
revoke(token) {
this.$http.delete('/oauth/tokens/' + token.id)
this.$http.delete(this.tokensUrl +'/'+ token.id)
.then(response => {
this.getTokens();
});

View file

@ -219,6 +219,7 @@
/*
* The component's data.
*/
props: ['clientsUrl'],
data() {
return {
clients: [],
@ -271,7 +272,7 @@
* Get all of the OAuth clients for the user.
*/
getClients() {
this.$http.get('/oauth/clients')
this.$http.get(this.clientsUrl)
.then(response => {
this.clients = response.data;
});
@ -289,7 +290,7 @@
*/
store() {
this.persistClient(
'post', '/oauth/clients',
'post', this.clientsUrl,
this.createForm, '#modal-create-client'
);
},
@ -310,7 +311,7 @@
*/
update() {
this.persistClient(
'put', '/oauth/clients/' + this.editForm.id,
'put', this.clientsUrl + '/' + this.editForm.id,
this.editForm, '#modal-edit-client'
);
},
@ -319,8 +320,10 @@
* Persist the client to storage using the given form.
*/
persistClient(method, uri, form, modal) {
console.log('persisting');
form.errors = [];
console.log('method: ' + method);
this.$http[method](uri, form)
.then(response => {
this.getClients();
@ -344,7 +347,7 @@
* Destroy the given client.
*/
destroy(client) {
this.$http.delete('/oauth/clients/' + client.id)
this.$http.delete(this.clientsUrl +'/' + client.id)
.then(response => {
this.getClients();
});

View file

@ -160,6 +160,7 @@
<script>
export default {
props: ['tokenUrl', 'scopesUrl'],
/*
* The component's data.
*/
@ -209,7 +210,7 @@
* Get all of the personal access tokens for the user.
*/
getTokens() {
this.$http.get('/oauth/personal-access-tokens')
this.$http.get(this.tokenUrl)
.then(response => {
this.tokens = response.data;
});
@ -219,7 +220,7 @@
* Get all of the available scopes.
*/
getScopes() {
this.$http.get('/oauth/scopes')
this.$http.get(this.scopesUrl)
.then(response => {
this.scopes = response.data;
});
@ -240,7 +241,7 @@
this.form.errors = [];
this.$http.post('/oauth/personal-access-tokens', this.form)
this.$http.post(this.tokenUrl, this.form)
.then(response => {
this.form.name = '';
this.form.scopes = [];
@ -293,7 +294,7 @@
* Revoke the given token.
*/
revoke(token) {
this.$http.delete('/oauth/personal-access-tokens/' + token.id)
this.$http.delete(this.tokenUrl +'/'+ token.id)
.then(response => {
this.getTokens();
});

View file

@ -9,7 +9,10 @@
{{-- Page content --}}
@section('content')
@if (!config('app.lock_passwords'))
<passport-personal-access-tokens></passport-personal-access-tokens>
<passport-personal-access-tokens
token-url="{{ url('oauth/personal-access-tokens') }}"
scopes-url="{{ url('oauth/scopes') }}">
</passport-personal-access-tokens>
@else
<p class="help-block">{{ trans('general.feature_disabled') }}</p>
@endif

View file

@ -14,8 +14,8 @@
@section('content')
@if (!config('app.lock_passwords'))
<div id="app">
<passport-clients></passport-clients>
<passport-authorized-clients></passport-authorized-clients>
<passport-clients clients-url="{{ url('oauth/clients') }}"></passport-clients>
<passport-authorized-clients clients-url="{{ url('oauth/clients') }}" tokens-url="{{ url('oauth/tokens') }}"></passport-authorized-clients>
</div>
@else
<p class="help-block">{{ trans('general.feature_disabled') }}</p>