feat(auth): fix change password error message
This commit was merged in pull request #107.
This commit is contained in:
@@ -316,7 +316,7 @@ func (handler AuthImpl) handleChangePasswordComp() http.HandlerFunc {
|
|||||||
|
|
||||||
err := handler.service.ChangePassword(user, session.Id, currPass, newPass)
|
err := handler.service.ChangePassword(user, session.Id, currPass, newPass)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
utils.TriggerToastWithStatus(w, r, "error", "Password not correct", http.StatusBadRequest)
|
utils.TriggerToastWithStatus(w, r, "error", err.Error(), http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ templ ChangePasswordComp(isPasswordReset bool) {
|
|||||||
Change Password
|
Change Password
|
||||||
</h2>
|
</h2>
|
||||||
if !isPasswordReset {
|
if !isPasswordReset {
|
||||||
<label class="input input-bordered flex items-center gap-2">
|
<label class="input flex items-center gap-2">
|
||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
class="grow"
|
class="grow"
|
||||||
@@ -27,7 +27,7 @@ templ ChangePasswordComp(isPasswordReset bool) {
|
|||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
}
|
}
|
||||||
<label class="input input-bordered flex items-center gap-2">
|
<label class="input flex items-center gap-2">
|
||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
class="grow"
|
class="grow"
|
||||||
@@ -39,7 +39,7 @@ templ ChangePasswordComp(isPasswordReset bool) {
|
|||||||
autocapitalize="off"
|
autocapitalize="off"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<button class="btn btn-primary self-end">
|
<button class="button button-primary px-2 self-end">
|
||||||
Change Password
|
Change Password
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user