Skip to content
Merged

fixes #1252

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function getAuthCallback(LinkService $service, $provider) {
$socialite->redirectUrl(str_replace('auth', 'login', url(config('services.'.$provider.'.redirect'))));
$result = $socialite->user();

$user = UserAlias::where('user_snowflake', $result->id)->first();
$user = UserAlias::where('site', $provider)->where('user_snowflake', $result->id)->first();
if (!$user) {
return redirect('/register/'.$provider)->with(['userData' => $result]);
}
Expand Down
4 changes: 4 additions & 0 deletions app/Models/Shop/ShopLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ public function getBaseCostAttribute() {

if (isset($this->cost['user']) && isset($this->cost['character'])) {
$assets = mergeAssetsArrays(parseAssetData($this->cost['user']), parseAssetData($this->cost['character']));
} elseif (isset($this->cost['user']) || isset($this->cost['character'])) {
$assets = isset($this->cost['user']) ? parseAssetData($this->cost['user']) : parseAssetData($this->cost['character']);
} else {
$assets = parseAssetData($this->cost);
}
Expand All @@ -160,6 +162,8 @@ public function getBaseCostAttribute() {
public function getDisplayCostAttribute() {
if (isset($this->cost['user']) && isset($this->cost['character'])) {
$assets = mergeAssetsArrays(parseAssetData($this->cost['user']), parseAssetData($this->cost['character']));
} elseif (isset($this->cost['user']) || isset($this->cost['character'])) {
$assets = isset($this->cost['user']) ? parseAssetData($this->cost['user']) : parseAssetData($this->cost['character']);
} else {
$assets = parseAssetData($this->cost);
}
Expand Down
4 changes: 2 additions & 2 deletions app/Services/InventoryManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ public function creditItem($sender, $recipient, $type, $data, $item, $quantity)
$recipient_stack = UserItem::where([
['user_id', '=', $recipient->id],
['item_id', '=', $item->id],
['data', '=', $data],
['data', '=', json_encode($data)], // this must be encoded since eloquent hasn't casted it yet
])->first();

if (!$recipient_stack) {
Expand All @@ -487,7 +487,7 @@ public function creditItem($sender, $recipient, $type, $data, $item, $quantity)
$recipient_stack = CharacterItem::where([
['character_id', '=', $recipient->id],
['item_id', '=', $item->id],
['data', '=', $data],
['data', '=', json_encode($data)],
])->first();

if (!$recipient_stack) {
Expand Down