Created
February 19, 2021 05:44
-
-
Save carlyleec/deda287f99dbe1fe39b1266254894c64 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def confirm_email(conn, %{"token" => token}) do | |
case Accounts.update_user_email(conn.assigns.current_user, token) do | |
:ok -> | |
conn | |
|> put_flash(:info, "Email changed successfully.") | |
|> redirect(to: Routes.user_settings_path(conn, :edit)) | |
:error -> | |
conn | |
|> put_flash(:error, "Email change link is invalid or it has expired.") | |
|> redirect(to: Routes.user_settings_path(conn, :edit)) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment