0
Sign in
One script reply has been approved by the moderators Verified
Created by adam186 386 days ago Viewed 5152 times
0
Submitted by adam186 Deno
Verified 386 days ago
1
import Surreal from "https://deno.land/x/surrealdb@v0.5.0/mod.ts";
2

3
/**
4
 * @returns The authenication token.
5
 */
6
export async function main(
7
  url: string,
8
  user: string,
9
  password: string,
10
  namespace?: string,
11
  database?: string,
12
  scope?: string,
13
) {
14
  const client = new Surreal(url);
15
  return await client.signin({
16
    user,
17
    pass: password,
18
    NS: namespace,
19
    DB: database,
20
    SC: scope,
21
  });
22
}
23