hackatime/app/jobs/handle_email_signin_job.rb
Mahad Kalam ef3f36c829
Inertia migration/UI3 (#911)
* Inertia p1?

* Inertia'fied signed out homepage?

* Split up signed in page

* WIP signed in v2?

* Better signed in?

* Clean up extensions page!

* Fix currently hacking

* Better docs page?

* Docs update 2

* Clean up "What is Hackatime?" + get rid of that godawful green dev mode

* Better nav?

* Cleaner settings?

* Fix commit times

* Fix flashes + OS improv

* Setup v2

* Readd some of the syncers?

* Remove stray emdash

* Clean up Step 3

* Oops, remove .vite

* bye bye, /inertia-example

* bin/rubocop -A

* Fix docs vuln
2026-02-09 11:26:30 +00:00

16 lines
520 B
Ruby

class HandleEmailSigninJob < ApplicationJob
queue_as :latency_10s
def perform(email, continue_param = nil)
email_address = ActiveRecord::Base.transaction do
EmailAddress.find_by(email: email) || begin
user = User.create!
user.email_addresses.create!(email: email, source: :signing_in)
end
end
token = email_address.user.create_email_signin_token(continue_param: continue_param).token
LoopsMailer.sign_in_email(email_address.email, token).deliver_now
token
end
end