auth.js 274 B

123456789101112
  1. export async function auth(token) {
  2. const tokenType = token.split(/\./).length === 3
  3. ? "app"
  4. : /^v\d+\./.test(token)
  5. ? "installation"
  6. : "oauth";
  7. return {
  8. type: "token",
  9. token: token,
  10. tokenType
  11. };
  12. }