Skip to content

Commit

Permalink
feat(CE): login invited user fix (#695) (#526)
Browse files Browse the repository at this point in the history
Co-authored-by: Basil V Bose <[email protected]>
  • Loading branch information
github-actions[bot] and bvb007 authored Dec 13, 2024
1 parent a5a1e0c commit 94b590b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions server/app/mailers/devise_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class DeviseMailer < Devise::Mailer
def invitation_instructions(record, token, opts = {})
@workspace = opts[:workspace]
@role = opts[:role]
@is_verified = opts[:is_verified] || false
@token = token
super
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<%= "#{@resource.invited_by.name} has invited you to use AI Squared with them, in a workspace called #{@workspace.name}." %>
</p>
<% query_params = { invited: true, invited_user:@resource.email, invitation_token: @token, workspace_id: @workspace.id, workspace_name: @workspace.name, invited_by: @resource.invited_by.name } %>
<% custom_url = "#{ENV['UI_HOST']}/sign-up?#{query_params.to_query}" %>
<% custom_url = @is_verified ? "#{ENV['UI_HOST']}/sign-in" : "#{ENV['UI_HOST']}/sign-up?#{query_params.to_query}" %>
<a
href="<%= custom_url %>"
style="display: inline-block; text-decoration: none"
Expand Down Expand Up @@ -96,7 +96,7 @@
margin: 0;
"
>
<% if @resource.invitation_due_at %>
<% if !@is_verified && @resource.invitation_due_at %>
<p><%= t("devise.mailer.invitation_instructions.accept_until", due_date: l(@resource.invitation_due_at, format: :'devise.mailer.invitation_instructions.accept_until_format')) %>
</p>
<% end %>
Expand Down

0 comments on commit 94b590b

Please sign in to comment.