mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-21 16:55:25 +03:00
Enable relative path hosting
This commit is contained in:
parent
a5865825da
commit
91419b3243
4 changed files with 6 additions and 5 deletions
|
@ -111,7 +111,7 @@ function App() {
|
|||
if (code) {
|
||||
console.log({ code });
|
||||
// Clear the code from the URL
|
||||
window.history.replaceState({}, document.title, '/');
|
||||
window.history.replaceState({}, document.title, location.pathname || '/');
|
||||
|
||||
const clientID = store.session.get('clientID');
|
||||
const clientSecret = store.session.get('clientSecret');
|
||||
|
|
|
@ -143,7 +143,7 @@ function Accounts({ onClose }) {
|
|||
accounts.splice(i, 1);
|
||||
store.local.setJSON('accounts', accounts);
|
||||
// location.reload();
|
||||
location.href = '/';
|
||||
location.href = location.pathname || '/';
|
||||
}}
|
||||
>
|
||||
<Icon icon="exit" />
|
||||
|
|
|
@ -4,8 +4,8 @@ const { VITE_CLIENT_NAME: CLIENT_NAME, VITE_WEBSITE: WEBSITE } = import.meta
|
|||
export async function registerApplication({ instanceURL }) {
|
||||
const registrationParams = new URLSearchParams({
|
||||
client_name: CLIENT_NAME,
|
||||
redirect_uris: location.origin,
|
||||
scopes: 'read write follow',
|
||||
redirect_uris: location.origin + location.pathname,
|
||||
website: WEBSITE,
|
||||
});
|
||||
const registrationResponse = await fetch(
|
||||
|
@ -27,7 +27,7 @@ export async function getAuthorizationURL({ instanceURL, client_id }) {
|
|||
const authorizationParams = new URLSearchParams({
|
||||
client_id,
|
||||
scope: 'read write follow',
|
||||
redirect_uri: location.origin,
|
||||
redirect_uri: location.origin + location.pathname,
|
||||
// redirect_uri: 'urn:ietf:wg:oauth:2.0:oob',
|
||||
response_type: 'code',
|
||||
});
|
||||
|
@ -44,7 +44,7 @@ export async function getAccessToken({
|
|||
const params = new URLSearchParams({
|
||||
client_id,
|
||||
client_secret,
|
||||
redirect_uri: location.origin,
|
||||
redirect_uri: location.origin + location.pathname,
|
||||
grant_type: 'authorization_code',
|
||||
code,
|
||||
scope: 'read write follow',
|
||||
|
|
|
@ -25,6 +25,7 @@ const rollbarCode = fs.readFileSync(
|
|||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
base: './',
|
||||
mode: NODE_ENV,
|
||||
define: {
|
||||
__BUILD_TIME__: JSON.stringify(now),
|
||||
|
|
Loading…
Reference in a new issue