Bootstrap default auth engine
This commit is contained in:
5
src/js/bootstrap.js
vendored
5
src/js/bootstrap.js
vendored
@ -55,7 +55,10 @@ var initialState = {
|
||||
ui: {
|
||||
current_tracklist: [],
|
||||
current_tltrack: false,
|
||||
notifications: []
|
||||
notifications: [],
|
||||
config: {
|
||||
authorization_url: 'https://jamesbarnsley.co.nz/auth.php'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user