Skip to content
Snippets Groups Projects
Commit ea62a55f authored by HJ's avatar HJ :fire:
Browse files

fix login

parent 9fd44e4a
No related branches found
No related tags found
1 merge request!681fix login
Pipeline #8932 passed
......@@ -38,6 +38,11 @@ module.exports = {
changeOrigin: true,
cookieDomainRewrite: 'localhost'
},
'/oauth': {
target,
changeOrigin: true,
cookieDomainRewrite: 'localhost'
},
'/nodeinfo': {
target,
changeOrigin: true,
......
import {reduce} from 'lodash'
const getOrCreateApp = ({oauth, instance}) => {
const url = `${instance}/api/v1/apps`
const url = `/api/v1/apps`
const form = new window.FormData()
form.append('client_name', `PleromaFE_${Math.random()}`)
......@@ -34,14 +34,14 @@ const login = (args) => {
}, false)
// Do the redirect...
const url = `${args.instance}/oauth/authorize?${dataString}`
const url = `/oauth/authorize?${dataString}`
window.location.href = url
})
}
const getTokenWithCredentials = ({app, instance, username, password}) => {
const url = `${instance}/oauth/token`
const url = `/oauth/token`
const form = new window.FormData()
form.append('client_id', app.client_id)
......@@ -64,7 +64,7 @@ const getToken = ({app, instance, code}) => {
form.append('client_secret', app.client_secret)
form.append('grant_type', 'authorization_code')
form.append('code', code)
form.append('redirect_uri', `${window.location.origin}/oauth-callback`)
form.append('redirect_uri', `/oauth-callback`)
return window.fetch(url, {
method: 'POST',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment