-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authorization, permissions, hub mutation #110
Conversation
…permissions on hub mutation.
lib/ret/perms_token.ex
Outdated
use Guardian, otp_app: :ret | ||
|
||
def subject_for_token(_resource, %{"account_id" => account_id, "hub_id" => hub_id}) do | ||
{:ok, "#{account_id |> to_string}_#{hub_id}"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this to_string
necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, nope
lib/ret_web/channels/hub_channel.ex
Outdated
|
||
hub = socket |> hub_for_socket | ||
|
||
account_id = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could also be factored account_id = if account do account.account_id else nil end
lgtm! nice work! |
…feature/authed-hub-mutation
Includes #108 and #107