Oauth user password reset : GWM

This commit is contained in:
Gowtham M 2025-08-04 14:27:35 +05:30
commit 34fa72e1e1
4 changed files with 9 additions and 1 deletions

BIN
.DS_Store vendored

Binary file not shown.

10
main.go
View File

@ -592,6 +592,13 @@ func main() {
if err != nil {
return c.JSON(http.StatusNotFound, map[string]string{"error": "User not found"})
}
//check the user type
isOAuthLogin := user.GetString("is_oauth_login")
if isOAuthLogin != "0" {
return c.JSON(http.StatusOK, map[string]string{"message": "Password reset is not available for accounts signed in with Apple or Google."})
}
name := user.GetString("name")
// Generate token
token := generateToken()
@ -608,7 +615,8 @@ func main() {
// Send email
subject := "Reset your FCSC password"
// resetURL := fmt.Sprintf("%s/api/auth/reset-password?token=%s", baseUrl, token)
resetURL := fmt.Sprintf("https://www.fcsc.com/forgot-password/%s", email)
//https://fcscapp.onelink.me/forgot-password/surendar.m@venbainfotech.com
resetURL := fmt.Sprintf("https://fcscapp.onelink.me/forgot-password/%s", email)
body := fmt.Sprintf(`
<!DOCTYPE html>

Binary file not shown.

BIN
pb_data/logs.db Executable file → Normal file

Binary file not shown.