mirror of
https://github.com/wanderer-industries/wanderer
synced 2026-03-26 13:28:00 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0891706489 | ||
|
|
7d720dcfb5 | ||
|
|
63b40b9c75 | ||
|
|
fc167fafaf |
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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 ->
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user