fix(server):give higher preference to redirect_uri
While using forgot_password redirect URI was ignored if not present Resolves #275
This commit is contained in:
@@ -81,17 +81,22 @@ func GetOrganization() map[string]interface{} {
|
||||
}
|
||||
|
||||
// GetForgotPasswordURL to get url for given token and hostname
|
||||
func GetForgotPasswordURL(token, hostname string) string {
|
||||
resetPasswordUrl, err := memorystore.Provider.GetStringStoreEnvVariable(constants.EnvKeyResetPasswordURL)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
if resetPasswordUrl == "" {
|
||||
if err := memorystore.Provider.UpdateEnvVariable(constants.EnvKeyResetPasswordURL, hostname+"/app/reset-password"); err != nil {
|
||||
func GetForgotPasswordURL(token, hostname, redirectURI string) string {
|
||||
resetPasswordURL := redirectURI
|
||||
|
||||
if resetPasswordURL == "" {
|
||||
resetPasswordURL, err := memorystore.Provider.GetStringStoreEnvVariable(constants.EnvKeyResetPasswordURL)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
if resetPasswordURL == "" {
|
||||
if err := memorystore.Provider.UpdateEnvVariable(constants.EnvKeyResetPasswordURL, hostname+"/app/reset-password"); err != nil {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
}
|
||||
verificationURL := resetPasswordUrl + "?token=" + token
|
||||
|
||||
verificationURL := resetPasswordURL + "?token=" + token
|
||||
return verificationURL
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user