Skip to content

Commit

Permalink
chore: remove nil context
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Aug 29, 2023
1 parent f2acc89 commit 23953e1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 32 deletions.
21 changes: 9 additions & 12 deletions text/message_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,28 +177,25 @@ func NewInfoSelfServiceLoginContinue() *Message {

func NewLoginEmailWithCodeSent() *Message {
return &Message{
ID: InfoSelfServiceLoginEmailWithCodeSent,
Type: Info,
Text: "An email containing a code has been sent to the email address you provided. If you have not received an email, check the spelling of the address and retry the login.",
Context: context(nil),
ID: InfoSelfServiceLoginEmailWithCodeSent,
Type: Info,
Text: "An email containing a code has been sent to the email address you provided. If you have not received an email, check the spelling of the address and retry the login.",
}
}

func NewErrorValidationLoginCodeInvalidOrAlreadyUsed() *Message {
return &Message{
ID: ErrorValidationLoginCodeInvalidOrAlreadyUsed,
Text: "The login code is invalid or has already been used. Please try again.",
Type: Error,
Context: context(nil),
ID: ErrorValidationLoginCodeInvalidOrAlreadyUsed,
Text: "The login code is invalid or has already been used. Please try again.",
Type: Error,
}
}

func NewErrorValidationLoginRetrySuccessful() *Message {
return &Message{
ID: ErrorValidationLoginRetrySuccess,
Type: Error,
Text: "The request was already completed successfully and can not be retried.",
Context: context(nil),
ID: ErrorValidationLoginRetrySuccess,
Type: Error,
Text: "The request was already completed successfully and can not be retried.",
}
}

Expand Down
21 changes: 9 additions & 12 deletions text/message_registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,25 @@ func NewInfoSelfServiceRegistrationRegisterWebAuthn() *Message {

func NewRegistrationEmailWithCodeSent() *Message {
return &Message{
ID: InfoSelfServiceRegistrationEmailWithCodeSent,
Type: Info,
Text: "An email containing a code has been sent to the email address you provided. If you have not received an email, check the spelling of the address and retry the registration.",
Context: context(nil),
ID: InfoSelfServiceRegistrationEmailWithCodeSent,
Type: Info,
Text: "An email containing a code has been sent to the email address you provided. If you have not received an email, check the spelling of the address and retry the registration.",
}
}

func NewErrorValidationRegistrationCodeInvalidOrAlreadyUsed() *Message {
return &Message{
ID: ErrorValidationRegistrationCodeInvalidOrAlreadyUsed,
Text: "The registration code is invalid or has already been used. Please try again.",
Type: Error,
Context: context(nil),
ID: ErrorValidationRegistrationCodeInvalidOrAlreadyUsed,
Text: "The registration code is invalid or has already been used. Please try again.",
Type: Error,
}
}

func NewErrorValidationRegistrationRetrySuccessful() *Message {
return &Message{
ID: ErrorValidateionRegistrationRetrySuccess,
Type: Error,
Text: "The request was already completed successfully and can not be retried.",
Context: context(nil),
ID: ErrorValidateionRegistrationRetrySuccess,
Type: Error,
Text: "The request was already completed successfully and can not be retried.",
}
}

Expand Down
14 changes: 6 additions & 8 deletions text/message_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,18 +397,16 @@ func NewErrorValidationSuchNoWebAuthnUser() *Message {

func NewErrorValidationNoCodeUser() *Message {
return &Message{
ID: ErrorValidationNoCodeUser,
Text: "This account does not exist or has not setup sign in with code.",
Type: Error,
Context: context(nil),
ID: ErrorValidationNoCodeUser,
Text: "This account does not exist or has not setup sign in with code.",
Type: Error,
}
}

func NewErrorValidationTraitsMismatch() *Message {
return &Message{
ID: ErrorValidationTraitsMismatch,
Text: "The provided traits do not match the traits previously associated with this flow.",
Type: Error,
Context: context(nil),
ID: ErrorValidationTraitsMismatch,
Text: "The provided traits do not match the traits previously associated with this flow.",
Type: Error,
}
}

0 comments on commit 23953e1

Please sign in to comment.