Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
chore: rename users.authenticate_user (#66)
Browse files Browse the repository at this point in the history
chore: rename users.authenticate_user

feat: update readme
  • Loading branch information
NathanFlurry committed Mar 15, 2024
1 parent 2f15035 commit 9c03df3
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.png binary
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Open Game Backend Registry

This repository serves the default registry for Open Game Backend.

See the [OpenGB Engine repository](https://github.com/rivet-gg/opengb.git) for more information.

## Documentation

- [Quickstart](http://opengb.dev/concepts/quickstart)
- [All available modules](http://opengb.dev/modules)
- [Building modules](https://opengb.dev/build/crash-course)
- [OpenGB Engine internals](http://opengb.dev/engine/introduction)
- Visit [opengb.dev](http://opengb.dev/introduction) for more

## Looking for the Open Game Backend Engine?

See [rivet-gg/opengb](https://github.com/rivet-gg/opengb.git).

## Support

**Community**

[Create a GitHub issue](https://github.com/rivet-gg/opengb/issues) or [join our Discord](https://rivet.gg/discord).

**Enterprise**

The following companies provide enterprise support & custom modules for Open Game Backend:

- [Rivet](https://rivet.gg/support)
- _Create a PR to list your services for Open Game Backend_
2 changes: 1 addition & 1 deletion modules/auth/scripts/auth_email_passwordless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function run(
// Fetch existing user if session token is provided
let userId: string | undefined;
if (req.userToken) {
const { userId } = await ctx.modules.users.validateUserToken({
const { userId } = await ctx.modules.users.authenticateUser({
userToken: req.userToken,
});

Expand Down
2 changes: 1 addition & 1 deletion modules/currency/scripts/get_balance_by_token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function run(
): Promise<Response> {
await ctx.modules.rateLimit.throttlePublic({ requests: 25 });

const { userId } = await ctx.modules.users.validateUserToken({
const { userId } = await ctx.modules.users.authenticateUser({
userToken: req.userToken,
});
const { balance } = await ctx.modules.currency.getBalance({ userId });
Expand Down
2 changes: 1 addition & 1 deletion modules/friends/scripts/accept_request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function run(
): Promise<Response> {
await ctx.modules.rateLimit.throttlePublic({ requests: 50 });

const { userId } = await ctx.modules.users.validateUserToken({
const { userId } = await ctx.modules.users.authenticateUser({
userToken: req.userToken,
});

Expand Down
2 changes: 1 addition & 1 deletion modules/friends/scripts/decline_request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function run(
): Promise<Response> {
await ctx.modules.rateLimit.throttlePublic({ requests: 50 });

const { userId } = await ctx.modules.users.validateUserToken({
const { userId } = await ctx.modules.users.authenticateUser({
userToken: req.userToken,
});

Expand Down
2 changes: 1 addition & 1 deletion modules/friends/scripts/list_friends.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function run(
): Promise<Response> {
await ctx.modules.rateLimit.throttlePublic({ requests: 50 });

const { userId } = await ctx.modules.users.validateUserToken({
const { userId } = await ctx.modules.users.authenticateUser({
userToken: req.userToken,
});

Expand Down
2 changes: 1 addition & 1 deletion modules/friends/scripts/list_incoming_friend_requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function run(
): Promise<Response> {
await ctx.modules.rateLimit.throttlePublic({ requests: 50 });

const { userId } = await ctx.modules.users.validateUserToken({
const { userId } = await ctx.modules.users.authenticateUser({
userToken: req.userToken,
});

Expand Down
2 changes: 1 addition & 1 deletion modules/friends/scripts/list_outgoing_friend_requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function run(
): Promise<Response> {
await ctx.modules.rateLimit.throttlePublic({});

const { userId } = await ctx.modules.users.validateUserToken({
const { userId } = await ctx.modules.users.authenticateUser({
userToken: req.userToken,
});

Expand Down
2 changes: 1 addition & 1 deletion modules/friends/scripts/remove_friend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function run(
): Promise<Response> {
await ctx.modules.rateLimit.throttlePublic({ requests: 50 });

const { userId } = await ctx.modules.users.validateUserToken({
const { userId } = await ctx.modules.users.authenticateUser({
userToken: req.userToken,
});

Expand Down
2 changes: 1 addition & 1 deletion modules/friends/scripts/send_request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function run(
): Promise<Response> {
await ctx.modules.rateLimit.throttlePublic({});

const { userId } = await ctx.modules.users.validateUserToken({
const { userId } = await ctx.modules.users.authenticateUser({
userToken: req.userToken,
});

Expand Down
2 changes: 1 addition & 1 deletion modules/users/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ scripts:
public: true
create_user:
name: Create User
validate_user_token:
authenticate_user:
name: Validate User Token
description: Validate a user token. Throws an error if the token is invalid.
public: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RuntimeError } from "../_gen/mod.ts";
import { ScriptContext } from "../_gen/scripts/validate_user_token.ts";
import { ScriptContext } from "../_gen/scripts/authenticate_user.ts";

export interface Request {
userToken: string;
Expand Down
2 changes: 1 addition & 1 deletion modules/users/tests/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test("e2e", async (ctx: TestContext) => {
userId: user.id,
});

const { userId } = await ctx.modules.users.validateUserToken({
const { userId } = await ctx.modules.users.authenticateUser({
userToken: token.token,
});
assertEquals(user.id, userId);
Expand Down

0 comments on commit 9c03df3

Please sign in to comment.