mirror of
https://git.zx2c4.com/cgit
synced 2025-07-13 11:44:36 +02:00
auth: have cgit calculate login address
This way we're sure to use virtual root, or any other strangeness encountered. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
df00ab1096
commit
a431326e8f
6 changed files with 16 additions and 10 deletions
|
@ -73,6 +73,14 @@ const char *cgit_rooturl()
|
|||
return ctx.cfg.script_name;
|
||||
}
|
||||
|
||||
const char *cgit_loginurl()
|
||||
{
|
||||
static const char *login_url = 0;
|
||||
if (!login_url)
|
||||
login_url = fmtalloc("%s?p=login", cgit_rooturl());
|
||||
return login_url;
|
||||
}
|
||||
|
||||
char *cgit_repourl(const char *reponame)
|
||||
{
|
||||
if (ctx.cfg.virtual_root)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue