This repository has been archived by the owner on Jun 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #329 from renatomassaro/request-id
Support custom request ID
- Loading branch information
Showing
62 changed files
with
795 additions
and
517 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import Helix.Websocket.Request | ||
|
||
request Helix.Account.Websocket.Channel.Account.Requests.Logout do | ||
@moduledoc """ | ||
Invalidates the session token and shuts down the socket. | ||
""" | ||
|
||
alias Helix.Websocket | ||
alias Helix.Account.Websocket.Controller.Account, as: AccountController | ||
|
||
def check_params(request, _socket), | ||
do: reply_ok(request) | ||
|
||
def check_permissions(request, _socket), | ||
do: reply_ok(request) | ||
|
||
def handle_request(request, socket) do | ||
|
||
AccountController.logout(socket.assigns, %{}) | ||
|
||
socket | ||
|> Websocket.id() | ||
|> Helix.Endpoint.broadcast("disconnect", %{}) | ||
|
||
reply_ok(request) | ||
end | ||
|
||
def reply(_request, _socket), | ||
do: {:stop, :shutdown} | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.