Compare commits

..

4 Commits

Author SHA1 Message Date
CI
0891706489 chore: release version v1.97.5 2026-03-26 01:02:39 +00:00
Dmitry Popov
7d720dcfb5 Merge branch 'main' of github.com:wanderer-industries/wanderer 2026-03-26 02:02:08 +01:00
Dmitry Popov
63b40b9c75 fix(core): Fixed character re-auth issues 2026-03-26 02:02:04 +01:00
CI
fc167fafaf chore: [skip ci] 2026-03-26 00:11:47 +00:00
5 changed files with 41 additions and 9 deletions

View File

@@ -2,6 +2,15 @@
<!-- changelog -->
## [v1.97.5](https://github.com/wanderer-industries/wanderer/compare/v1.97.4...v1.97.5) (2026-03-26)
### Bug Fixes:
* core: Fixed character re-auth issues
## [v1.97.4](https://github.com/wanderer-industries/wanderer/compare/v1.97.3...v1.97.4) (2026-03-26)

View File

@@ -46,14 +46,18 @@ defmodule WandererApp.Ueberauth.Strategy.Eve do
|> with_param(:hl, conn)
|> with_state_param(conn)
opts = oauth_client_options_from_conn(conn, with_wallet, is_admin?)
WandererApp.Cache.put(
"eve_auth_#{params[:state]}",
[with_wallet: with_wallet, is_admin?: is_admin?],
[
with_wallet: with_wallet,
is_admin?: is_admin?,
tracking_pool: Keyword.get(opts, :tracking_pool)
],
ttl: :timer.minutes(30)
)
opts = oauth_client_options_from_conn(conn, with_wallet, is_admin?)
redirect!(conn, WandererApp.Ueberauth.Strategy.Eve.OAuth.authorize_url!(params, opts))
false ->

View File

@@ -10,6 +10,12 @@ defmodule WandererAppWeb.AuthController do
def callback(%{assigns: %{ueberauth_auth: auth, current_user: user} = _assigns} = conn, _params) do
active_tracking_pool = WandererApp.Character.TrackingConfigUtils.get_active_pool!()
Logger.info(
"[AuthController] SSO callback SUCCESS for eve_id=#{auth.info.email}, " <>
"has_token=#{not is_nil(auth.credentials.token)}, " <>
"has_refresh=#{not is_nil(auth.credentials.refresh_token)}"
)
character_data = %{
eve_id: "#{auth.info.email}",
name: auth.info.name,
@@ -40,6 +46,11 @@ defmodule WandererAppWeb.AuthController do
character
|> WandererApp.Api.Character.update(character_update)
Logger.info(
"[AuthController] Character #{character.id} tokens updated in DB, " <>
"access_token_present=#{not is_nil(character.access_token)}"
)
WandererApp.Character.update_character(character.id, character_update)
# Clear the invalid_grant counter so stale failures don't cause
@@ -108,7 +119,16 @@ defmodule WandererAppWeb.AuthController do
end
def callback(conn, _params) do
# This runs when Ueberauth auth FAILED — tokens are NOT updated
ueberauth_failure = conn.assigns[:ueberauth_failure]
Logger.warning(
"[AuthController] SSO callback FAILED - no ueberauth_auth in assigns. " <>
"Failure: #{inspect(ueberauth_failure)}"
)
conn
|> put_flash(:error, "Authorization failed. Please try again.")
|> redirect(to: "/characters")
end

View File

@@ -88,12 +88,11 @@ defmodule WandererAppWeb.CharactersLive do
{:ok, _} = WandererApp.MapCharacterSettingsRepo.untrack(settings)
end)
{:ok, updated_character} =
socket.assigns.characters
|> Enum.find(&(&1.id == character_id))
|> WandererApp.Api.Character.mark_as_deleted()
# Load character from DB instead of using plain map from assigns
{:ok, character} = WandererApp.Api.Character.by_id(character_id)
{:ok, _updated_character} = WandererApp.Api.Character.mark_as_deleted(character)
WandererApp.Character.update_character(character_id, updated_character)
WandererApp.Character.update_character(character_id, %{deleted: true, user_id: nil})
{:ok, characters} =
WandererApp.Api.Character.active_by_user(%{user_id: socket.assigns.user_id})

View File

@@ -3,7 +3,7 @@ defmodule WandererApp.MixProject do
@source_url "https://github.com/wanderer-industries/wanderer"
@version "1.97.4"
@version "1.97.5"
def project do
[