Oauth user password reset : GWM
This commit is contained in:
commit
34fa72e1e1
10
main.go
10
main.go
@ -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>
|
||||
|
||||
BIN
pb_data/data.db
BIN
pb_data/data.db
Binary file not shown.
BIN
pb_data/logs.db
Executable file → Normal file
BIN
pb_data/logs.db
Executable file → Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user