Skip to content

Commit

Permalink
Merge pull request #183 from jungju/master
Browse files Browse the repository at this point in the history
Added a prefix to login URL.
  • Loading branch information
sunfmin committed Jan 21, 2024
2 parents 13e8ffd + b4c4d7a commit 6185b8e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions login/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,29 @@ func (b *Builder) HomeURLFunc(v HomeURLFunc) (r *Builder) {
return b
}

func (b *Builder) URIPrefix(v string) (r *Builder) {
prefix := strings.TrimRight(v, "/")

b.loginPageURL = prefix + b.loginPageURL
b.LogoutURL = prefix + b.LogoutURL
b.validateTOTPURL = prefix + b.validateTOTPURL
b.totpSetupPageURL = prefix + b.totpSetupPageURL
b.totpValidatePageURL = prefix + b.totpValidatePageURL
b.oauthBeginURL = prefix + b.oauthBeginURL
b.oauthCallbackURL = prefix + b.oauthCallbackURL
b.oauthCallbackCompleteURL = prefix + b.oauthCallbackCompleteURL
b.passwordLoginURL = prefix + b.passwordLoginURL
b.resetPasswordURL = prefix + b.resetPasswordURL
b.resetPasswordPageURL = prefix + b.resetPasswordPageURL
b.changePasswordURL = prefix + b.changePasswordURL
b.changePasswordPageURL = prefix + b.changePasswordPageURL
b.forgetPasswordPageURL = prefix + b.forgetPasswordPageURL
b.sendResetPasswordLinkURL = prefix + b.sendResetPasswordLinkURL
b.resetPasswordLinkSentPageURL = prefix + b.resetPasswordLinkSentPageURL

return b
}

func (b *Builder) LoginPageURL(v string) (r *Builder) {
b.loginPageURL = v
return b
Expand Down

0 comments on commit 6185b8e

Please sign in to comment.