login

package
v0.0.0-...-73c3907 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpenChangePasswordDialogEvent = "login_openChangePasswordDialog"
)

Variables

View Source
var DefaultViewCommon = &ViewCommon{
	WrapperClass: "d-flex pt-16 flex-column mx-auto",
	WrapperStyle: "max-width: 28rem;",
	TitleClass:   "text-h5 mb-6 font-weight-bold",
	LabelClass:   "d-block mb-1 grey--text text--darken-2 text-sm-body-2",
}

Functions

func New

func New(pb *presets.Builder) *login.Builder

Types

type ViewCommon

type ViewCommon struct {
	WrapperClass string
	WrapperStyle string
	TitleClass   string
	LabelClass   string
}

func (*ViewCommon) ErrNotice

func (vc *ViewCommon) ErrNotice(msg string) HTMLComponent

func (*ViewCommon) ErrorBody

func (vc *ViewCommon) ErrorBody(msg string) HTMLComponent

func (*ViewCommon) FormSubmitBtn

func (vc *ViewCommon) FormSubmitBtn(
	label string,
) *v.VBtnBuilder

func (*ViewCommon) InfoNotice

func (vc *ViewCommon) InfoNotice(msg string) HTMLComponent

func (*ViewCommon) InjectRecaptchaAssets

func (vc *ViewCommon) InjectRecaptchaAssets(ctx *web.EventContext, formID string, tokenFieldID string)

requirements: - submit button

  • add class `g-recaptcha`
  • add attr `data-sitekey=<key>`
  • add attr `data-callback=onSubmit`

- add token field like `Input("token").Id("token").Type("hidden")`

func (*ViewCommon) InjectZxcvbn

func (vc *ViewCommon) InjectZxcvbn(ctx *web.EventContext)

func (*ViewCommon) Input

func (vc *ViewCommon) Input(
	id string,
	placeholder string,
	val string,
) *v.VTextFieldBuilder

func (*ViewCommon) Notice

func (vc *ViewCommon) Notice(vh *login.ViewHelper, msgr *login.Messages, w http.ResponseWriter, r *http.Request) HTMLComponent

func (*ViewCommon) PasswordInput

func (vc *ViewCommon) PasswordInput(
	id string,
	placeholder string,
	val string,
	canReveal bool,
) *v.VTextFieldBuilder

func (*ViewCommon) PasswordInputWithStrengthMeter

func (vc *ViewCommon) PasswordInputWithStrengthMeter(in *v.VTextFieldBuilder, id string, val string) HTMLComponent

need to import zxcvbn.js

func (*ViewCommon) WarnNotice

func (vc *ViewCommon) WarnNotice(msg string) HTMLComponent

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL