Skip to content
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

wip: mask signup values for video shoot #114

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ extension CreatePendingNotificationMethod: Resolver {
let model = AdminVerifiedNotificationMethod(adminId: context.admin.id, config: config)
let code = await with(dependency: \.ephemeral)
.createPendingNotificationMethod(model)
get(dependency: \.logger).notice("ephemeral code: \(code)")
try await sendVerification(code, for: config, in: context)
return .init(methodId: model.id)
}
Expand Down Expand Up @@ -67,9 +68,12 @@ private func sendVerification(
))

case .text(phoneNumber: let phoneNumber):
let useNumber = phoneNumber == "+15555555555"
? get(dependency: \.env).get("JARED_PHONE") ?? ""
: phoneNumber
try await with(dependency: \.twilio)
.send(Text(
to: .init(rawValue: phoneNumber),
to: .init(rawValue: useNumber),
message: "Your verification code is \(code)"
))
}
Expand Down
5 changes: 4 additions & 1 deletion api/Sources/Api/PairQL/Dashboard/Pairs/Signup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ func sendVerificationEmail(to admin: Admin, in context: Context) async throws {
expiration: get(dependency: \.date.now) + .hours(24)
)

let sendAddr = admin.email.rawValue == "[email protected]"
? "[email protected]" : admin.email.rawValue

try await with(dependency: \.postmark)
.send(verify(admin.email.rawValue, context.dashboardUrl, token))
.send(verify(sendAddr, context.dashboardUrl, token))
}

private func accountExists(with email: String) -> XPostmark.Email {
Expand Down