@thetinkerinc/sprout 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/index.d.ts +2 -7
- package/dist/auth/index.js +2 -6
- package/package.json +1 -1
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
declare function getEmail(userId: string): Promise<string>;
|
|
2
|
-
declare function getUserId(email: string): Promise<string>;
|
|
3
|
-
declare const _default: {
|
|
4
|
-
getEmail: typeof getEmail;
|
|
5
|
-
getUserId: typeof getUserId;
|
|
6
|
-
};
|
|
7
|
-
export default _default;
|
|
1
|
+
export declare function getEmail(userId: string): Promise<string>;
|
|
2
|
+
export declare function getUserId(email: string): Promise<string>;
|
package/dist/auth/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createClerkClient } from 'svelte-clerk/server';
|
|
2
2
|
import { PUBLIC_CLERK_PUBLISHABLE_KEY } from '$env/static/public';
|
|
3
3
|
import { CLERK_SECRET_KEY } from '$env/static/private';
|
|
4
|
-
async function getEmail(userId) {
|
|
4
|
+
export async function getEmail(userId) {
|
|
5
5
|
const clerk = getClerk();
|
|
6
6
|
const user = await clerk.users.getUser(userId);
|
|
7
7
|
return user.emailAddresses[0].emailAddress;
|
|
8
8
|
}
|
|
9
|
-
async function getUserId(email) {
|
|
9
|
+
export async function getUserId(email) {
|
|
10
10
|
const clerk = getClerk();
|
|
11
11
|
const users = await clerk.users.getUserList({
|
|
12
12
|
limit: 1,
|
|
@@ -23,7 +23,3 @@ function getClerk() {
|
|
|
23
23
|
secretKey: CLERK_SECRET_KEY
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
export default {
|
|
27
|
-
getEmail,
|
|
28
|
-
getUserId
|
|
29
|
-
};
|