prongs
GitHub

auth.required

Nobody is signed in, and this needs a signed-in user

Profile

Raised with

Status

401

Message

yours
Read https://www.prongs.dev/docs/intents/auth/required.md and tell me whether auth.required fits what I am building.

Example

TS
return fail('auth.required');
The caller gets
Terminal
HTTP 401

{
"ok": false,
"error": "Sign in required.",
"code": "auth.required"
}

Connections

Choosing between neighbours

  • If it is

    Use

  • Nobody is signed in, and this needs a signed-in user

    auth.required
  • A signed-in caller who may not do this

    permission.denied

For registry authors

Starter intents. These are the intents prongs add errors puts in your registry, raised with fail(). Change the messages to suit your app, and the statuses through the status.* intents they are built from.

The entry prongs add errors writes into your registry. Change the message here, or the status through its status.* ref.

TS
'auth.required': {
kind: 'semantic',
description: 'Nobody is signed in, and this needs a signed-in user',
refs: ['status.unauthorized'],
keywords: ['signed out', 'login', 'unauthenticated'],
notFor: [
{
context: 'a signed-in caller who may not do this',
instead: 'permission.denied',
},
],
binding: { publicMessage: 'Sign in required.' },
},