Bootstrap default auth engine

This commit is contained in:
James Barnsley
2017-06-12 18:04:00 +12:00
parent 0edc2ecea4
commit 2460ab3b41
3 changed files with 6 additions and 3 deletions

5
src/js/bootstrap.js vendored
View File

@ -55,7 +55,10 @@ var initialState = {
ui: {
current_tracklist: [],
current_tltrack: false,
notifications: []
notifications: [],
config: {
authorization_url: 'https://jamesbarnsley.co.nz/auth.php'
}
}
};

View File

@ -146,7 +146,7 @@ class SpotifyAuthenticationFrame extends React.Component{
const mapStateToProps = (state, ownProps) => {
return {
authorization_url: (state.ui.config && state.ui.config.authorization_url ? state.ui.config.authorization_url : 'https://jamesbarnsley.co.nz/auth.php'),
authorization_url: state.ui.config.authorization_url,
authorized: state.spotify.authorized,
authorizing: state.spotify.authorizing,
refreshing_token: state.spotify.refreshing_token

View File

@ -111,7 +111,7 @@ function refreshToken( dispatch, getState ){
$.ajax({
method: 'GET',
url: getState().config.authorization_url+'?action=refresh&refresh_token='+getState().spotify.refresh_token,
url: getState().ui.config.authorization_url+'?action=refresh&refresh_token='+getState().spotify.refresh_token,
dataType: "json",
timeout: 10000
})