validate user link format (#93)

This commit is contained in:
Luna D 2020-04-19 15:21:00 -04:00
parent fb08f555f4
commit 3d16c4d4c0
No known key found for this signature in database
GPG key ID: D0F46C94720BAA4B

View file

@ -52,6 +52,7 @@ defmodule Philomena.UserLinks.UserLink do
|> put_assoc(:tag, tag) |> put_assoc(:tag, tag)
|> put_assoc(:user, user) |> put_assoc(:user, user)
|> validate_required([:user, :uri, :public]) |> validate_required([:user, :uri, :public])
|> validate_format(:uri, ~r|\Ahttps?://|)
|> parse_uri() |> parse_uri()
|> put_verification_code() |> put_verification_code()
|> put_next_check_at() |> put_next_check_at()