dont overwrite endpoint on new login, update endpoint on /me request

This commit is contained in:
2024-09-22 15:11:26 +02:00
parent dcfe1dc191
commit 57cdb3dbc9
3 changed files with 2 additions and 2 deletions

View File

@@ -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;
} }

View File

@@ -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,

View File

@@ -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")
} }