mirror of
https://github.com/teamhanko/hanko.git
synced 2025-10-27 14:17:56 +08:00
26 lines
443 B
Go
26 lines
443 B
Go
package shared
|
|
|
|
import (
|
|
"github.com/teamhanko/hanko/backend/v2/flowpilot"
|
|
)
|
|
|
|
type Back struct{}
|
|
|
|
func (a Back) GetName() flowpilot.ActionName {
|
|
return ActionBack
|
|
}
|
|
|
|
func (a Back) GetDescription() string {
|
|
return "Navigate one step back."
|
|
}
|
|
|
|
func (a Back) Initialize(c flowpilot.InitializationContext) {
|
|
if !c.StateIsRevertible() {
|
|
c.SuspendAction()
|
|
}
|
|
}
|
|
|
|
func (a Back) Execute(c flowpilot.ExecutionContext) error {
|
|
return c.Revert()
|
|
}
|