У нас вы можете посмотреть бесплатно Golang HTTP User Authentication Yabi Series 19 | Golang Web Development | WebAssembly Auth System или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
In this Golang Web Development Series #39, we're building a complete Golang HTTP User Authentication System from scratch with the backend MySQL database by using Golang's official MySQL Database Driver. The Golang HTTP Authentication will consist of Golang User Registration, Golang Login Auth, Golang Password Reset, Golang Change Password, Golang Set Cookie, Golang Web Assembly (WASM), Golang Map Token, Golang Persisted Token, etc. with step by step guide here in Golang's Web Development Series. #MaharlikansCode #GolangWebDevelopment3 #GolangTutorial #LearnGolangWebDevelopment #Golang #LifeAsSoftwareDeveloper #Maharlikans #FilipinoSoftwareDeveloper Get Linode Account: https://www.linode.com/?r=6aae17162e9... If you go with extra mile for buying me a cup of coffee, I appreciate it guys: https://ko-fi.com/maharlikanscode Source Codes: yabi/user.go: // PasswordResetNewPassword set a new password from a reset password process func PasswordResetNewPassword(dbCon *sql.DB, email, newPassword, confirmPassword, pwToken, secretKey string) (bool, error) { // Check if email is empty if len(strings.TrimSpace(email)) == 0 { return false, errors.New("Email is Required") } // Check if email address is valid or not if !sakto.IsEmailValid(email) { return false, errors.New("Invalid Email Address, please try again") } // Check if the email address exist or not if IsUserEmailExist(dbCon, email) { return false, errors.New("Email is not Found, please try again") } // Check if new password is empty if len(strings.TrimSpace(newPassword)) == 0 { return false, errors.New("Password is Required") } // Check if confirm password is empty if len(strings.TrimSpace(confirmPassword)) == 0 { return false, errors.New("Confirm Password is Required") } // New and confirm password is not match. if newPassword != confirmPassword { return false, errors.New("Password is not Match") } // Now, change the password here isPasswordChange, err := UpdateUserPassword(dbCon, email, newPassword) if err != nil { return false, err } if !isPasswordChange { return false, err } // Encrypt the email value to store this in the map memory as the key. encToken, err := tago.Encrypt(pwToken, secretKey) if err != nil { itrlog.Error("ERROR FROM email: ", err) return false, errors.New("Oops!, encryption failed, please try again") } // Delete the specified encrypted token once successfully change the password _, err = timaan.UT.Remove(pwToken) if err != nil { itrlog.Error(err) } // Delete from the "yabi_user_token" table as well dbYabi, err := sql.Open("mysql", YB.DBConStr) if err != nil { itrlog.Error(err) } defer dbYabi.Close() DeleteUserToken(dbYabi, encToken, YabiTokenPasswordReset) return true, nil } // UpdateUserPassword update the user's current password func UpdateUserPassword(dbCon *sql.DB, email, plainTextPassword string) (bool, error) { // Hash and salt your plain text password hsPassword, err := sakto.HashAndSalt([]byte(plainTextPassword)) if err != nil { return false, err } upd, err := dbCon.Prepare("UPDATE " + YabiUser + " SET password = ? WHERE email = ?" + " AND is_active = ? ORDER BY ID DESC LIMIT 1") if err != nil { itrlog.Error("ERROR FROM UpdateUserPassword: ", err) return false, err } // Pass on all the parameter values here upd.Exec(hsPassword, email, true) // activate the user's status now defer upd.Close() return true, nil } Get the full source codes: https://github.com/maharlikanscode/Go...