mirror of
https://github.com/JuLi0n21/pwa-player.git
synced 2026-04-19 15:30:05 +00:00
dont overwrite endpoint on new login, update endpoint on /me request
This commit is contained in:
@@ -50,6 +50,7 @@ async function getMe() {
|
|||||||
|
|
||||||
console.log("active user: ", data.name)
|
console.log("active user: ", data.name)
|
||||||
userStore.setUser(data);
|
userStore.setUser(data);
|
||||||
|
userStore.baseUrl.value = data.endpoint;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,6 @@ func SaveUser(user User) error {
|
|||||||
query := `INSERT INTO users (id, name, endpoint, avatar_url, access_token, refresh_token, expire_date) VALUES (?, ?, ?, ?, ?, ?, ?)
|
query := `INSERT INTO users (id, name, endpoint, avatar_url, access_token, refresh_token, expire_date) VALUES (?, ?, ?, ?, ?, ?, ?)
|
||||||
ON CONFLICT(id) DO UPDATE SET
|
ON CONFLICT(id) DO UPDATE SET
|
||||||
name = excluded.name,
|
name = excluded.name,
|
||||||
endpoint = excluded.endpoint,
|
|
||||||
avatar_url = excluded.avatar_url,
|
avatar_url = excluded.avatar_url,
|
||||||
access_token = excluded.access_token,
|
access_token = excluded.access_token,
|
||||||
refresh_token = excluded.refresh_token,
|
refresh_token = excluded.refresh_token,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ func main() {
|
|||||||
panic(".env not found")
|
panic(".env not found")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("Not Produktion Enviorment fallback to dev.env")
|
fmt.Println("Fallback to dev.env")
|
||||||
if ok := godotenv.Load("dev.env"); ok != nil {
|
if ok := godotenv.Load("dev.env"); ok != nil {
|
||||||
panic("dev.env not found")
|
panic("dev.env not found")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user