✨ Register with preferred language
This commit is contained in:
parent
79844c414b
commit
62a3168190
63
.idea/workspace.xml
generated
63
.idea/workspace.xml
generated
@ -4,9 +4,10 @@
|
|||||||
<option name="autoReloadType" value="ALL" />
|
<option name="autoReloadType" value="ALL" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":bug: Bug fixes on localization">
|
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":bug: Fix email html rendering">
|
||||||
<change beforePath="$PROJECT_DIR$/pkg/internal/services/factors.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/services/factors.go" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/pkg/internal/services/tokens.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/services/tokens.go" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/pkg/internal/http/api/accounts_api.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/http/api/accounts_api.go" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/pkg/internal/services/accounts.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/services/accounts.go" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@ -45,35 +46,35 @@
|
|||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
<option name="showLibraryContents" value="true" />
|
<option name="showLibraryContents" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent"><![CDATA[{
|
<component name="PropertiesComponent">{
|
||||||
"keyToString": {
|
"keyToString": {
|
||||||
"DefaultGoTemplateProperty": "Go File",
|
"DefaultGoTemplateProperty": "Go File",
|
||||||
"Go Build.Backend.executor": "Run",
|
"Go Build.Backend.executor": "Run",
|
||||||
"Go 构建.Backend.executor": "Run",
|
"Go 构建.Backend.executor": "Run",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"RunOnceActivity.git.unshallow": "true",
|
"RunOnceActivity.git.unshallow": "true",
|
||||||
"RunOnceActivity.go.formatter.settings.were.checked": "true",
|
"RunOnceActivity.go.formatter.settings.were.checked": "true",
|
||||||
"RunOnceActivity.go.migrated.go.modules.settings": "true",
|
"RunOnceActivity.go.migrated.go.modules.settings": "true",
|
||||||
"RunOnceActivity.go.modules.automatic.dependencies.download": "true",
|
"RunOnceActivity.go.modules.automatic.dependencies.download": "true",
|
||||||
"RunOnceActivity.go.modules.go.list.on.any.changes.was.set": "true",
|
"RunOnceActivity.go.modules.go.list.on.any.changes.was.set": "true",
|
||||||
"git-widget-placeholder": "master",
|
"git-widget-placeholder": "master",
|
||||||
"go.import.settings.migrated": "true",
|
"go.import.settings.migrated": "true",
|
||||||
"go.sdk.automatically.set": "true",
|
"go.sdk.automatically.set": "true",
|
||||||
"last_opened_file_path": "/Users/littlesheep/Documents/Projects/Hypernet/Passport",
|
"last_opened_file_path": "/Users/littlesheep/Documents/Projects/Hypernet/Passport",
|
||||||
"node.js.detected.package.eslint": "true",
|
"node.js.detected.package.eslint": "true",
|
||||||
"node.js.selected.package.eslint": "(autodetect)",
|
"node.js.selected.package.eslint": "(autodetect)",
|
||||||
"nodejs_package_manager_path": "npm",
|
"nodejs_package_manager_path": "npm",
|
||||||
"run.code.analysis.last.selected.profile": "pProject Default",
|
"run.code.analysis.last.selected.profile": "pProject Default",
|
||||||
"settings.editor.selected.configurable": "preferences.intentionPowerPack",
|
"settings.editor.selected.configurable": "preferences.intentionPowerPack",
|
||||||
"ts.external.directory.path": "/Users/littlesheep/Documents/Projects/Hydrogen/Passport/web/node_modules/typescript/lib",
|
"ts.external.directory.path": "/Users/littlesheep/Documents/Projects/Hydrogen/Passport/web/node_modules/typescript/lib",
|
||||||
"vue.rearranger.settings.migration": "true"
|
"vue.rearranger.settings.migration": "true"
|
||||||
},
|
},
|
||||||
"keyToStringList": {
|
"keyToStringList": {
|
||||||
"DatabaseDriversLRU": [
|
"DatabaseDriversLRU": [
|
||||||
"postgresql"
|
"postgresql"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}]]></component>
|
}</component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
<key name="CopyFile.RECENT_KEYS">
|
<key name="CopyFile.RECENT_KEYS">
|
||||||
<recent name="$PROJECT_DIR$/keys" />
|
<recent name="$PROJECT_DIR$/keys" />
|
||||||
@ -159,7 +160,6 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
|
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
|
||||||
<MESSAGE value=":truck: Rename daily-sign to check-in" />
|
|
||||||
<MESSAGE value=":sparkles: Result modifiers in check-in" />
|
<MESSAGE value=":sparkles: Result modifiers in check-in" />
|
||||||
<MESSAGE value=":boom: Passing relationship api arguments in body instead of querystring" />
|
<MESSAGE value=":boom: Passing relationship api arguments in body instead of querystring" />
|
||||||
<MESSAGE value=":sparkles: Better check in experience random algorithm" />
|
<MESSAGE value=":sparkles: Better check in experience random algorithm" />
|
||||||
@ -184,7 +184,8 @@
|
|||||||
<MESSAGE value=":sparkles: Push email & notification localization" />
|
<MESSAGE value=":sparkles: Push email & notification localization" />
|
||||||
<MESSAGE value=":globe_with_meridians: Fully localized notification" />
|
<MESSAGE value=":globe_with_meridians: Fully localized notification" />
|
||||||
<MESSAGE value=":bug: Bug fixes on localization" />
|
<MESSAGE value=":bug: Bug fixes on localization" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value=":bug: Bug fixes on localization" />
|
<MESSAGE value=":bug: Fix email html rendering" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value=":bug: Fix email html rendering" />
|
||||||
<option name="GROUP_MULTIFILE_MERGE_BY_DIRECTORY" value="true" />
|
<option name="GROUP_MULTIFILE_MERGE_BY_DIRECTORY" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="VgoProject">
|
<component name="VgoProject">
|
||||||
|
@ -153,6 +153,7 @@ func doRegister(c *fiber.Ctx) error {
|
|||||||
Nick string `json:"nick" validate:"required"`
|
Nick string `json:"nick" validate:"required"`
|
||||||
Email string `json:"email" validate:"required,email"`
|
Email string `json:"email" validate:"required,email"`
|
||||||
Password string `json:"password" validate:"required,min=4,max=32"`
|
Password string `json:"password" validate:"required,min=4,max=32"`
|
||||||
|
Language string `json:"language" validate:"required,bcp47_language_tag"`
|
||||||
MagicToken string `json:"magic_token"`
|
MagicToken string `json:"magic_token"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,6 +182,7 @@ func doRegister(c *fiber.Ctx) error {
|
|||||||
data.Nick,
|
data.Nick,
|
||||||
data.Email,
|
data.Email,
|
||||||
data.Password,
|
data.Password,
|
||||||
|
data.Language,
|
||||||
); err != nil {
|
); err != nil {
|
||||||
return fiber.NewError(fiber.StatusBadRequest, err.Error())
|
return fiber.NewError(fiber.StatusBadRequest, err.Error())
|
||||||
} else {
|
} else {
|
||||||
|
@ -122,7 +122,7 @@ func SearchAccount(probe string) ([]models.Account, error) {
|
|||||||
return accounts, nil
|
return accounts, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateAccount(name, nick, email, password string) (models.Account, error) {
|
func CreateAccount(name, nick, email, password, lang string) (models.Account, error) {
|
||||||
user := models.Account{
|
user := models.Account{
|
||||||
Name: name,
|
Name: name,
|
||||||
Nick: nick,
|
Nick: nick,
|
||||||
@ -143,6 +143,7 @@ func CreateAccount(name, nick, email, password string) (models.Account, error) {
|
|||||||
VerifiedAt: nil,
|
VerifiedAt: nil,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Language: lang,
|
||||||
PermNodes: datatypes.JSONMap{},
|
PermNodes: datatypes.JSONMap{},
|
||||||
ConfirmedAt: nil,
|
ConfirmedAt: nil,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user