PhoenixKit 1.7.217: SMTP security settings, sessions and post-login redirects
PhoenixKit 1.7.217 gives SMTP connections their own encryption and certificate settings, and adds user settings for sessions, email confirmation and where users land after signing in.
The SMTP integration gets five optional fields: encryption, when to authenticate, certificate checking, a CA certificate bundle and a timeout. Left blank, a connection sends as before, and an unknown value is refused. Username and password are no longer required, for relays that need no login. Email Sending now warns when the sender is not a full address, such as the default noreply@localhost, which the email log silently drops.
Settings → Users gets Require email confirmation before using the app (on by default, as before), a Sessions section with Allow “Keep me logged in” (persistent sessions) and Check it by default (users can still untick it), and Post-Login Redirects with an After-login path and an After-registration path.
The sign-in page now keeps the page a user came from when they switch to magic link, QR code, social sign-in or registration. Confirmation email resends are limited to three per five minutes per address.
Full release notes: PhoenixKit 1.7.217
1.7.217 · 28 July 2026
Added
- SMTP transport settings (#668) — five optional setup fields on the
smtpintegration provider:security(auto/ssl/starttls/starttls_optional/none),auth(if_available/always/never),verify_cert(verify_peer/verify_none),ca_cert(a PEM bundle that replaces the system store for that connection) andtimeout(seconds). Blank reproduces the previous port-based rule exactly, so existing connections send unchanged; unknown values are refused rather than coerced back toauto, so a typo cannot silently downgrade a connection’s encryption. The Test Connection probe builds from the sameSmtpTransport.config/1options as the send path. - Optional
maybe_enqueue/2callback onPhoenixKit.Email.Provider(#668) — offered right afterintercept_before_send/2on both delivery paths, so an email package can take delivery over for every outgoing message, including the host application’s password resets and confirmations.{:queued, ref}short-circuits the send and reaches the caller as{:ok, %{id: ref, queued: true}};:continuesends normally. Guarded byfunction_exported?/3, so a package built against an older core is unaffected.skip_queue: truelets a queue worker ask for the real send. - Setup fields render by
:type(#668) —setup_field/1now honors:select,:textareaand:numberinstead of forcingtype="text", with a text-input fallback for a type it has never heard of. The website-wide integration form uses the shared component instead of a hand-rolled copy, so the two forms can no longer drift. - Sender-address warning on the Email Sending settings page (#668) — a
sender that is not a full address (the built-in default
noreply@localhostamong them) is silently refused by the email tracking module’sLogchangeset, so mail went out and the log stayed empty with nothing in the UI saying why. The page now warns, both in a banner and on save. Chartcore component (#669) — server-rendered SVGline_chart/1,sparkline/1andbar_chart/1. No JS, no external library; theme-aware viacurrentColor, and live by construction (assigns change → SVG re-renders). Points may be{x, y}tuples or%{x: _, y: _}maps,Decimalis converted automatically, and non-numeric points are dropped rather than crashing the page — with an:emptyslot for “nothing usable left”.StatusDotcore component (#669) — semantic coloured dot with an optional label andpulse, plus a screen-reader state name so the state is not carried by colour alone.ConnectAccountButtoncore component +PopupLinkJS hook (#669) — OAuth-popup account linking (distinct fromOAuthProvider, which is app sign-in). A real<a href>intercepted only oncewindow.openreturns a window, so a blocked popup, JS being off, or a modifier-click all fall back to ordinary navigation.value_coloron<.stat_card>(#669) — for values whose colour is information (a price coloured by cheapness). Any;is stripped so the value cannot append further declarations.mix test.js(#669) —node --testover the pure logic in the shipped hook bundle, wired intomix precommit. Skips itself when node is not installed, or when the glob matches nothing.
Changed
<.stat_card>’sroundedattr is now honored (#669). It was previously declared and ignored — the class was hardcodedrounded-box. Two consequences for consumers: a caller that already passedrounded="xl"now actually getsrounded-xl, and the attr has a closedvalues:list (box,none,sm,md,lg,xl,2xl,3xl,full), so a value outside it emits a compile-time warning. The whitelist exists because Tailwind scans source for literal class names — an interpolatedrounded-#{@rounded}produces a class with no CSS behind it.- SMTP
usernameandpasswordare no longer required fields. An internal relay that authenticates by IP has no login to give, andSmtpTransporthas always had a credential-less branch — but marking the fields required made it, and the newauth: never/security: nonesettings, impossible to reach: the form refused to submit andconnected?/1refused to call the connection configured, so mail silently fell back to the built-in mailer.hostandportremain required. The Test Connection probe stops forcingauth: alwayswhen there is no login to prove, which would otherwise have failed every such relay. - Personal integrations form clears blanks like the website form does. It
dropped blank values for every field, so a cleared optional field — an SMTP
CA bundle, a timeout — kept its old value while the form showed empty. Blanks
are now dropped for
:passwordfields only, matchingSettings.IntegrationForm, and values are trimmed on both paths.
Fixed
mix precommitfailed on dialyzer — the sender-address check added in #668 had an unreachable catch-all clause (pattern_match_cov), which haltedmix dialyzerwith exit status 2 and, because aliases run in order, meant the newtest.jsstep never ran at all.:typeis read softly on the integration save paths too.setup_field/1was hardened to tolerate a provider field map without:type(external modules contribute providers throughintegration_providers/0), but both save paths still didfield.type— so such a provider rendered fine and then raisedKeyErroron submit, after the operator had committed to their input.- SMTP
timeoutno longer accepts a number with a unit.Integer.parse/1returns30for both"30s"and"30 minutes", so an operator who typed minutes got a 30-second timeout with no complaint. The remainder must now be empty. deliver_via_integration/3’s documented error list now names the five SMTP transport-setting reasons added in #668.
PhoenixKit 1.7.217. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.