@@ 38,14 38,10 @@ var (
)
const (
- USER_UNCONFIRMED = "UNCONFIRMED"
- USER_ACTIVE_NON_PAYING = "ACTIVE_NON_PAYING"
- USER_ACTIVE_FREE = "ACTIVE_FREE"
- USER_ACTIVE_PAYING = "ACTIVE_PAYING"
- USER_ACTIVE_DELINQUENT = "ACTIVE_DELINQUENT"
- USER_ADMIN = "ADMIN"
- USER_UNKNOWN = "UNKNOWN"
- USER_SUSPENDED = "SUSPENDED"
+ USER_TYPE_PENDING = "UNCONFIRMED"
+ USER_TYPE_USER = "ACTIVE_NON_PAYING"
+ USER_TYPE_ADMIN = "ADMIN"
+ USER_TYPE_SUSPENDED = "SUSPENDED"
)
const (
@@ 132,7 128,7 @@ func authForUsername(ctx context.Context, username string) (*AuthContext, error)
return nil, err
}
- if auth.UserType == USER_SUSPENDED {
+ if auth.UserType == USER_TYPE_SUSPENDED {
return nil, fmt.Errorf(
"Account suspended with the following notice: %s\nContact support",
*auth.SuspensionNotice)
@@ 193,7 189,7 @@ func authForOAuthClient(ctx context.Context, clientUUID string) (*AuthContext, e
return nil, err
}
- if auth.UserType == USER_SUSPENDED {
+ if auth.UserType == USER_TYPE_SUSPENDED {
return nil, fmt.Errorf(
"Account suspended with the following notice: %s\nContact support",
*auth.SuspensionNotice)
@@ 555,7 551,7 @@ func OAuth2(token string, hash [64]byte, w http.ResponseWriter,
return
}
- if auth.UserType == USER_SUSPENDED {
+ if auth.UserType == USER_TYPE_SUSPENDED {
authError(w, fmt.Sprintf(
"Account suspended with the following notice: %s\nContact support",
*auth.SuspensionNotice), http.StatusForbidden)
@@ 644,7 640,7 @@ func LegacyOAuth(bearer string, hash [64]byte, w http.ResponseWriter,
return
}
- if auth.UserType == USER_SUSPENDED {
+ if auth.UserType == USER_TYPE_SUSPENDED {
authError(w, fmt.Sprintf(
"Account suspended with the following notice: %s\nContact support",
*auth.SuspensionNotice), http.StatusForbidden)