(Feat): Initial Commit
Some checks failed
Build & Test / build-test (push) Has been cancelled
Build & Test / swagger-codegen-cli (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled

This commit is contained in:
2026-07-03 19:41:31 +05:30
commit 7e940c83a7
461 changed files with 45002 additions and 0 deletions

55
internal/util/url/url.go Normal file
View File

@@ -0,0 +1,55 @@
package url
import (
"fmt"
"net/url"
"path"
"allaboutapps.dev/aw/go-starter/internal/config"
)
const (
queryParamToken = "token"
accountConfirmationPath = "/api/v1/auth/register"
)
func PasswordResetDeeplinkURL(config config.Server, token string) (*url.URL, error) {
u, err := url.Parse(config.Frontend.BaseURL)
if err != nil {
return nil, fmt.Errorf("failed to parse the base URL: %w", err)
}
u.Path = path.Join(u.Path, config.Frontend.PasswordResetEndpoint)
q := u.Query()
q.Set(queryParamToken, token)
u.RawQuery = q.Encode()
return u, nil
}
func ConfirmationDeeplinkURL(config config.Server, token string) (*url.URL, error) {
u, err := url.Parse(config.Echo.BaseURL)
if err != nil {
return nil, fmt.Errorf("failed to parse the base URL: %w", err)
}
u.Path = path.Join(u.Path, accountConfirmationPath)
q := u.Query()
q.Set(queryParamToken, token)
u.RawQuery = q.Encode()
return u, nil
}
func ConfirmationRequestURL(config config.Server, token string) (*url.URL, error) {
u, err := url.Parse(config.Echo.BaseURL)
if err != nil {
return nil, fmt.Errorf("failed to parse the base URL: %w", err)
}
u.Path = path.Join(u.Path, accountConfirmationPath, token)
return u, nil
}