Skip to content

Commit c212b2a

Browse files
committed
feat: add magic function for generating login URLs
- Introduced a new `magic` function in the admin module to create login URLs using the provided email and optional return path, enhancing user authentication flow.
1 parent c39cd86 commit c212b2a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/algora/admin/admin.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ defmodule Algora.Admin do
1717

1818
require Logger
1919

20+
def magic(email, return_to \\ nil),
21+
do: AlgoraWeb.Endpoint.url() <> AlgoraWeb.UserAuth.generate_login_path(email, return_to)
22+
2023
def screenshot(path), do: AlgoraWeb.OGImageController.take_and_upload_screenshot([path])
2124

2225
def alert(message, severity \\ :error)

0 commit comments

Comments
 (0)