Skip to content

Commit 61c1707

Browse files
committed
feat: enqueue job to fetch top contributions on GitHub OAuth
1 parent c564c70 commit 61c1707

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/algora_web/controllers/oauth_callback_controller.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ defmodule AlgoraWeb.OAuthCallbackController do
2626
{:ok, info} <- Github.OAuth.exchange_access_token(code: code, state: state),
2727
%{info: info, primary_email: primary, emails: emails, token: token} = info,
2828
{:ok, user} <- Accounts.register_github_user(conn.assigns[:current_user], primary, info, emails, token) do
29+
%{provider_login: info["login"]}
30+
|> Algora.Workspace.Jobs.FetchTopContributions.new()
31+
|> Oban.insert()
32+
2933
if socket_id do
3034
Phoenix.PubSub.broadcast(Algora.PubSub, "auth:#{socket_id}", {:authenticated, user})
3135
end

0 commit comments

Comments
 (0)