Comments (2)
I'm not sure this is a correct way to use modifiers, they are meant to provide functionality to a given element or based on it's lifecycle.
If you just need to do some conditional work based on your authentication status, then you should be able to just inject session service and use it's isAuthenticated
property inside a template.
If you need to run some code when authentication succeeded, the session service exposes authenticationSucceeded
and invalidationSucceeded
events.
See the docs for the reference
https://ember-simple-auth.com/api/classes/SessionService.html
// some-component.js
import Component from "@glimmer/component";
import { service } from "@ember/service";
export default class SomeComponent extends Component {
@service session;
}
Otherwise, if you'd like to have modifier semantics I'd recommend did-update
from https://github.com/emberjs/ember-render-modifiers
Then in the template you'd be able to do this:
from ember-simple-auth.
Ok thanks, I ended up realizing I could use isAuthenticated and had overthought the issue! Appreciate the feedback
from ember-simple-auth.
Related Issues (20)
- Expected Error format when login fails HOT 7
- DEPRECATION: The <(unknown):ember362>#host computed property was just overridden.
- Deprecation: `old-deprecate-method-paths` HOT 1
- Ember Simple Auth: The automatic session initialization is deprecated on Ember 3.28.4 HOT 9
- Is Torii addon abandonned ? HOT 9
- Ember 4.1.0: Use of `assign` has been deprecated. Please use `Object.assign` or the spread operator instead. HOT 1
- Unhandled Promise error detected when using the manual session.setup function HOT 9
- When I logout of one tab the authenticated data still seems to be populated in another tab HOT 1
- v2 addon format HOT 5
- Typescript error on accessing prohibitAuthentication HOT 3
- CookieStore is not initializing/syncing correctly HOT 2
- Dependency Dashboard
- CookieExpirationTime not being set HOT 2
- When syncing tabs (session store), schedule of the refresh token should be updated
- ember-polyfills.deprecate-assign deprication in Ember 4.4 HOT 2
- Action Required: Fix Renovate Configuration
- ESA's Application route hides host app's route when using pod layout & embroider HOT 5
- Access token does not persist HOT 1
- Neither of test apps work - did you stop maintaining it? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-simple-auth.