feat: get origin from client (#679)

This commit is contained in:
三咲智子 Kevin Deng 2023-01-02 03:30:39 +08:00 committed by GitHub
parent d8abea75aa
commit d0567c0d18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 15 deletions

View file

@ -26,7 +26,12 @@ async function oauth() {
server = server.split('/')[0]
try {
location.href = await $fetch<string>(`/api/${server || DEFAULT_SERVER}/login`)
location.href = await $fetch<string>(`/api/${server || DEFAULT_SERVER}/login`, {
method: 'POST',
body: {
origin: location.origin,
},
})
}
catch {
displayError = true