(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{124:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return f}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var u=o.a.createContext({}),p=function(e){var t=o.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},d=function(e){var t=p(e.components);return o.a.createElement(u.Provider,{value:t},e.children)},l={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},h=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,i=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),d=p(n),h=r,f=d["".concat(i,".").concat(h)]||d[h]||l[h]||a;return n?o.a.createElement(f,c(c({ref:t},u),{},{components:n})):o.a.createElement(f,c({ref:t},u))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=h;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:r,i[1]=c;for(var u=2;u\n {\n auth.Stop();\n Token token = await auth.ExchangeCode(payload.Code);\n SpotifyWebAPI api = new SpotifyWebAPI()\n {\n TokenType = token.TokenType,\n AccessToken = token.AccessToken\n };\n // Do requests with API client\n };\n auth.Start(); // Starts an internal HTTP Server\n auth.OpenBrowser();\n}\n')),Object(a.b)("h2",{id:"token-refresh"},"Token Refresh"),Object(a.b)("p",null,"Once the ",Object(a.b)("inlineCode",{parentName:"p"},"AccessToken")," is expired, you can use your ",Object(a.b)("inlineCode",{parentName:"p"},"RefreshToken")," to get a new one.\nIn this procedure, no HTTP Server is needed in the background and a single HTTP Request is made."),Object(a.b)("pre",null,Object(a.b)("code",{parentName:"pre",className:"language-csharp"},"// Auth code from above\n\nif(token.IsExpired())\n{\n Token newToken = await auth.RefreshToken(token.RefreshToken);\n api.AccessToken = newToken.AccessToken\n api.TokenType = newToken.TokenType\n}\n")))}p.isMDXComponent=!0}}]);