generated from PackagrIO/goweb-template
-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add basic user management * allow admin to create another admin * fix tests * add multi user info to README
- Loading branch information
1 parent
fa0decc
commit 4a82064
Showing
35 changed files
with
678 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
package auth | ||
|
||
import ( | ||
"github.com/fastenhealth/fasten-onprem/backend/pkg" | ||
) | ||
|
||
type UserMetadata struct { | ||
FullName string `json:"full_name"` | ||
Picture string `json:"picture"` | ||
Email string `json:"email"` | ||
FullName string `json:"full_name"` | ||
Picture string `json:"picture"` | ||
Email string `json:"email"` | ||
Role pkg.UserRole `json:"role"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package _20240813222836 | ||
|
||
import ( | ||
"github.com/fastenhealth/fasten-onprem/backend/pkg/models" | ||
) | ||
|
||
type Role string | ||
|
||
const ( | ||
RoleUser Role = "user" | ||
RoleAdmin Role = "admin" | ||
) | ||
|
||
type User struct { | ||
models.ModelBase | ||
FullName string `json:"full_name"` | ||
Username string `json:"username" gorm:"unique"` | ||
Password string `json:"password"` | ||
|
||
//additional optional metadata that Fasten stores with users | ||
Picture string `json:"picture"` | ||
Email string `json:"email"` | ||
Role Role `json:"role"` | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.